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 # Load packager's settings if any
# #
if [ -n "${DESTDIR}" -a -f ../shorewall-pkg.config ]; then if [ -f ./.shorewallrc ]; then
. ../shorewall-pkg.config || exit 1 . ./.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 elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1 . ~/.shorewallrc || exit 1
file=~/.shorewallrc file=~/.shorewallrc
elif - -f ${SHOREWALLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
file=${SHOREWALLRC_HOME}/.shorewallrc
fi fi
elif [ $# -eq 1 ]; then elif [ $# -eq 1 ]; then
file=$1 file=$1
@ -155,7 +165,7 @@ elif [ $# -eq 1 ]; then
/*|.*) /*|.*)
;; ;;
*) *)
file=./$file file=./$file || 1
;; ;;
esac esac

View File

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

View File

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

View File

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

View File

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