Installer tweaks

- Give instructions when Shorewall-core installer finds no rc file
- Update help

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-25 07:49:52 -07:00
parent 5aed14ffdc
commit 8a18dac870
4 changed files with 25 additions and 10 deletions

View File

@ -27,7 +27,7 @@ VERSION=xxx #The Build script inserts the actual version
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME [ <rcfile> ] "
echo "usage: $ME [ <configuration-file> ] "
echo " $ME -v"
echo " $ME -h"
exit $1
@ -148,9 +148,6 @@ if [ $# -eq 0 ]; then
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
else
file=./shorewallrc.default
. $file
fi
elif [ $# -eq 1 ]; then
file=$1
@ -254,6 +251,23 @@ case "$HOST" in
;;
esac
if [ -z "$file" ]; then
if $HOST = linux; then
file=shorewallrc.default
else
file=$shorewallrc.${HOST}
fi
echo "You have not specified a configuration file and ~/.shorewallrc does not exist" >&2
echo "Shorewall-core $VERSION has determined that the $file configuration is appropriate for your system" >&2
echo "Please review the settings in that file. If you wish to change them, make a copy and modify the copy" >&2
echo "Then re-run install.sh passing either $file or the name of your modified copy" >&2
echo "" >&2
echo "Example:" >&2
echo "" >&2
echo " ./install.sh $file" &>2
fi
if [ -n "$DESTDIR" ]; then
if [ $BUILD != cygwin ]; then
if [ `id -u` != 0 ] ; then

View File

@ -28,7 +28,7 @@ VERSION=xxx #The Build script inserts the actual version.
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME"
echo "usage: $ME [ <configuration-file> ]"
echo " $ME -v"
echo " $ME -h"
exit $1
@ -143,7 +143,7 @@ if [ $# -eq 0 ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
else
fatal_error "No rcfile specified and ~/.shorewallrc not found"
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fi
elif [ $# -eq 1 ]; then
file=$1

View File

@ -27,7 +27,7 @@ VERSION=xxx #The Build script inserts the actual version
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME"
echo "usage: $ME [ <configuration-file> ]"
echo " $ME -v"
echo " $ME -h"
exit $1
@ -158,7 +158,7 @@ if [ $# -eq 0 ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
else
fatal_error "No rcfile specified and ~/.shorewallrc not found"
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fi
elif [ $# -eq 1 ]; then
file=$1

View File

@ -30,7 +30,7 @@ VERSION=xxx #The Build script inserts the actual version
usage() # $1 = exit status
{
ME=$(basename $0)
echo "usage: $ME"
echo "usage: $ME [ <configuration-file> ]"
echo " $ME -v"
echo " $ME -h"
echo " $ME -s"
@ -177,11 +177,12 @@ if [ $# -eq 0 ]; then
#
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then
. ../shorewall-pkg.config || exit 1
file = ../shorewall-pkg.config
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
else
fatal_error "No rcfile specified and ~/.shorewallrc not found"
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fi
elif [ $# -eq 1 ]; then
file=$1