Fix param handling in restore-base

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@2654 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2005-09-09 16:52:10 +00:00
parent f35c0922c6
commit 1d763c84df
2 changed files with 26 additions and 1 deletions

View File

@ -8359,7 +8359,7 @@ define_firewall() # $1 = Command (Start or Restart)
f=$(find_file params)
[ -f $f ] && \
save_command ". $f"
save_command ". $(resolve_file $f)"
save_command "#"
save_command "COMMAND=restore"

View File

@ -162,6 +162,31 @@ find_file()
esac
}
#
# Get fully-qualified name of file
#
resolve_file() # $1 = file name
{
local pwd=$PWD
case $1 in
/*)
echo $1
;;
./*)
echo ${pwd}${1#.}
;;
../*)
cd ..
echo ${PWD}${1#..}
cd $pwd
;;
*)
echo $pwd/$1
;;
esac
}
#
# Replace commas with spaces and echo the result
#