mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-24 08:33:40 +01:00
Restore working 'stop_firewall' for generated script -- take 2
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3304 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
109d78c694
commit
9db140bc5e
@ -8992,30 +8992,29 @@ run_tc() {
|
|||||||
|
|
||||||
stop_firewall() {
|
stop_firewall() {
|
||||||
|
|
||||||
[ -n "${RESTOREFILE:=restore}" ]
|
[ -n "\${RESTOREFILE:=restore}" ]
|
||||||
|
|
||||||
RESTOREPATH=/var/lib/shorewall/$RESTOREFILE
|
RESTOREPATH=/var/lib/shorewall/\$RESTOREFILE
|
||||||
|
|
||||||
if [ -x $RESTOREPATH ]; then
|
if [ -x \$RESTOREPATH ]; then
|
||||||
|
if [ -x \${RESTOREPATH}-ipsets ]; then
|
||||||
if [ -x ${RESTOREPATH}-ipsets ]; then
|
|
||||||
progress_message2 Restoring Ipsets...
|
progress_message2 Restoring Ipsets...
|
||||||
#
|
#
|
||||||
# We must purge iptables to be sure that there are no
|
# We must purge iptables to be sure that there are no
|
||||||
# references to ipsets
|
# references to ipsets
|
||||||
#
|
#
|
||||||
for table in mangle nat filter; do
|
for table in mangle nat filter; do
|
||||||
iptables -t $table -F
|
iptables -t \$table -F
|
||||||
iptables -t $table -X
|
iptables -t \$table -X
|
||||||
done
|
done
|
||||||
|
|
||||||
${RESTOREPATH}-ipsets
|
\${RESTOREPATH}-ipsets
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo Restoring Shorewall...
|
echo Restoring Shorewall...
|
||||||
|
|
||||||
if $RESTOREPATH; then
|
if \$RESTOREPATH; then
|
||||||
echo "Shorewall restored from $RESTOREPATH"
|
echo "Shorewall restored from \$RESTOREPATH"
|
||||||
set_state "Started"
|
set_state "Started"
|
||||||
else
|
else
|
||||||
set_state "Unknown"
|
set_state "Unknown"
|
||||||
@ -9024,11 +9023,10 @@ stop_firewall() {
|
|||||||
/sbin/shorewall nolock stop
|
/sbin/shorewall nolock stop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kill $$
|
kill \$\$
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__EOF__
|
__EOF__
|
||||||
f=$(find_file params)
|
f=$(find_file params)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user