mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-01 07:25:42 +02:00
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:
parent
f35c0922c6
commit
1d763c84df
@ -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"
|
||||
|
@ -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
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user