Improve 'find_file'; Remove extraneous backslash

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@4816 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2006-11-09 00:44:27 +00:00
parent aafbe86404
commit 71b29cfe99

View File

@ -81,7 +81,6 @@ progress_message3() # $* = Message
split() { split() {
local ifs=$IFS local ifs=$IFS
IFS=: IFS=:
set -- $1
echo $* echo $*
IFS=$ifs IFS=$ifs
} }
@ -767,7 +766,7 @@ find_first_interface_address_if_any() # $1 = interface
# #
interface_is_usable() # $1 = interface interface_is_usable() # $1 = interface
{ {
interface_is_up $1 && [ "\$(find_first_interface_address_if_any $1)" != 0.0.0.0 ] interface_is_up $1 && [ "$(find_first_interface_address_if_any $1)" != 0.0.0.0 ]
} }
# #
@ -831,7 +830,7 @@ ensure_config_path() {
} }
# #
# Find a File -- For relative file name, look first in $SHOREWALL_DIR then in ${CONFDIR} # Find a File -- For relative file name, look in ${SHOREWALL_DIR} then each ${CONFIG_PATH} then ${CONFDIR}
# #
find_file() find_file()
{ {
@ -845,18 +844,13 @@ find_file()
if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then if [ -n "$SHOREWALL_DIR" -a -f $SHOREWALL_DIR/$1 ]; then
echo $SHOREWALL_DIR/$1 echo $SHOREWALL_DIR/$1
else else
saveifs=$IFS for directory in $(split $CONFIG_PATH); do
IFS=:
for directory in $CONFIG_PATH; do
if [ -f $directory/$1 ]; then if [ -f $directory/$1 ]; then
echo $directory/$1 echo $directory/$1
IFS=$saveifs
return return
fi fi
done done
IFS=$saveifs
echo ${CONFDIR}/$1 echo ${CONFDIR}/$1
fi fi
;; ;;
@ -1324,7 +1318,6 @@ undo_routing() {
} }
restore_default_route() { restore_default_route() {
if [ -z "$NOROUTES" -a -f ${VARDIR}/default_route ]; then if [ -z "$NOROUTES" -a -f ${VARDIR}/default_route ]; then
local default_route= route local default_route= route