Restore logic to make find_file() check for SHOREWALL_DIR

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1259 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2004-04-10 16:46:20 +00:00
parent e0e00293fe
commit 7763011f16
4 changed files with 19 additions and 20 deletions

View File

@ -9,3 +9,5 @@ Changes since 2.0.1
4) Implement CONFIG_PATH.
5) Apply Stijn Jonker's fix for CONFIG_PATH.
6) Restore logic to make 'find_file' check for SHOREWALL_DIR separately.

View File

@ -5740,8 +5740,6 @@ do_initialize() {
run_user_exit params
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
config=$(find_file shorewall.conf)
if [ -f $config ]; then
@ -5755,7 +5753,6 @@ do_initialize() {
# Restore CONFIG_PATH if the shorewall.conf file cleared it
#
[ -n "$CONFIG_PATH" ] || CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
#
# Determine the capabilities of the installed iptables/netfilter
#

View File

@ -94,19 +94,23 @@ find_file()
echo $1
;;
*)
saveifs=$IFS
IFS=:
for directory in $CONFIG_PATH; do
if [ -f $directory/$1 ]; then
echo $directory/$1
IFS=$saveifs
return
fi
done
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
echo $SHOREWALL_DIR/$1
else
saveifs=$IFS
IFS=:
for directory in $CONFIG_PATH; do
if [ -f $directory/$1 ]; then
echo $directory/$1
IFS=$saveifs
return
fi
done
IFS=$saveifs
echo /etc/shorewall/$1
IFS=$saveifs
echo /etc/shorewall/$1
fi
;;
esac
}

View File

@ -632,7 +632,6 @@ FUNCTIONS=$SHARED_DIR/functions
VERSION_FILE=$SHARED_DIR/version
HELP=$SHARED_DIR/help
CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
if [ -f $FUNCTIONS ]; then
. $FUNCTIONS
@ -650,10 +649,7 @@ else
exit 2
fi
if [ -z "$CONFIG_PATH" ]; then
CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -n "$SHOREWALL_DIR" ] && CONFIG_PATH=$SHOREWALL_DIR:$CONFIG_PATH
fi
[ -z "$CONFIG_PATH" ] && CONFIG_PATH=/etc/shorewall:/usr/share/shorewall
[ -z "${STATEDIR}" ] && STATEDIR=/var/state/shorewall