Update install scripts to look for .shorewallrc in many places

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-26 17:01:55 -07:00
parent b31f656d63
commit f2311f1987
5 changed files with 51 additions and 12 deletions

View File

@ -143,11 +143,21 @@ if [ $# -eq 0 ]; then
#
# Load packager's settings if any
#
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then
. ../shorewall-pkg.config || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
file=./.shorewallrc
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
file=/root/.shoreallrc
elif [ -r /.shorewallrc ]; then
. /.shorewallrc || exit 1
file =/.shoreallrc
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
file=${SHOREWALLRC_HOME}/.shorewallrc
fi
elif [ $# -eq 1 ]; then
file=$1
@ -155,7 +165,7 @@ elif [ $# -eq 1 ]; then
/*|.*)
;;
*)
file=./$file
file=./$file || 1
;;
esac

View File

@ -35,7 +35,7 @@ SHOREWALL_CAPVERSION=40502
if [ -z "$g_readrc" ]; then
if [ -f ./.shorewallrc ]; then
. ~/.shorewallrc || exit 1
. ./.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then

View File

@ -137,11 +137,21 @@ if [ $# -eq 0 ]; then
#
# Load packager's settings if any
#
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then
. ../shorewall-pkg.config || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
file=./.shorewallrc
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
file=/root/.shoreallrc
elif [ -r /.shorewallrc ]; then
. /.shorewallrc || exit 1
file =/.shoreallrc
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
file=${SHOREWALLRC_HOME}/.shorewallrc
else
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fi

View File

@ -152,11 +152,21 @@ if [ $# -eq 0 ]; then
#
# Load packager's settings if any
#
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then
. ../shorewall-pkg.config || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
file=./.shorewallrc
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
file=/root/.shoreallrc
elif [ -r /.shorewallrc ]; then
. /.shorewallrc || exit 1
file =/.shoreallrc
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
file=${SHOREWALLRC_HOME}/.shorewallrc
else
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fi

View File

@ -175,14 +175,23 @@ if [ $# -eq 0 ]; then
#
# Load packager's settings if any
#
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then
. ../shorewall-pkg.config || exit 1
file = ../shorewall-pkg.config
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
file=./.shorewallrc
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
file=/root/.shoreallrc
elif [ -r /.shorewallrc ]; then
. /.shorewallrc || exit 1
file =/.shoreallrc
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
file=~/.shorewallrc
elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
file=${SHOREWALLRC_HOME}/.shorewallrc
else
fatal_error "No configuration file specified and ~/.shorewallrc not found"
fatal_error "No configuration file specified and .shorewallrc not found"
fi
elif [ $# -eq 1 ]; then
file=$1