mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-30 11:33:28 +01:00
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:
parent
aafbe86404
commit
71b29cfe99
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user