diff --git a/Shorewall/firewall b/Shorewall/firewall index 35b07840e..88ed68ec7 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -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" diff --git a/Shorewall/functions b/Shorewall/functions index d8b9156e1..d062eb965 100755 --- a/Shorewall/functions +++ b/Shorewall/functions @@ -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 #