mirror of
https://gitlab.com/shorewall/code.git
synced 2025-06-25 04:01:45 +02: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
|
# Echos the fully-qualified name of the calling shell program
|
||||||
#
|
#
|
||||||
my_pathname() {
|
my_pathname() {
|
||||||
|
local pwd
|
||||||
|
pwd=$PWD
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
echo $PWD/$(basename $0)
|
echo $PWD/$(basename $0)
|
||||||
|
cd $pwd
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -534,7 +534,8 @@ EOF
|
|||||||
run_start_exit
|
run_start_exit
|
||||||
do_iptables -N shorewall
|
do_iptables -N shorewall
|
||||||
set_state Started $config_dir
|
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
|
run_started_exit
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
Loading…
x
Reference in New Issue
Block a user