mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-07 16:24:01 +01:00
Try to ensure that cp doesn't copy the firewall script to itself.
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
ea71f15b3d
commit
56318e6cc8
@ -272,8 +272,11 @@ shorewall6_is_started() {
|
||||
# Echos the fully-qualified name of the calling shell program
|
||||
#
|
||||
my_pathname() {
|
||||
local pwd
|
||||
pwd=$PWD
|
||||
cd $(dirname $0)
|
||||
echo $PWD/$(basename $0)
|
||||
cd $pwd
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -534,7 +534,8 @@ EOF
|
||||
run_start_exit
|
||||
do_iptables -N shorewall
|
||||
set_state Started $config_dir
|
||||
[ \$0 = \${VARDIR}/firewall ] || cp -f \$(my_pathname) \${VARDIR}/firewall
|
||||
my_pathname=\$(my_pathname)
|
||||
[ \$my_pathname = \${VARDIR}/firewall ] || cp -f \$my_pathname \${VARDIR}/firewall
|
||||
run_started_exit
|
||||
fi
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user