forked from extern/shorewall_code
Make 'shorewall save' repeatable
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1290 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
0ec2b0210c
commit
d58ef6d813
@ -5353,9 +5353,9 @@ define_firewall() # $1 = Command (Start or Restart)
|
|||||||
|
|
||||||
save_command 'iptables-restore << EOF'
|
save_command 'iptables-restore << EOF'
|
||||||
|
|
||||||
mv -f /var/lib/shorewall/restore-$$ /var/lib/shorewall/restore-new
|
mv -f /var/lib/shorewall/restore-$$ /var/lib/shorewall/restore-base
|
||||||
|
|
||||||
chmod +x /var/lib/shorewall/restore-new
|
chmod +x /var/lib/shorewall/restore-base
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -966,13 +966,14 @@ case "$1" in
|
|||||||
|
|
||||||
if iptables -L dynamic -n > /var/lib/shorewall/save; then
|
if iptables -L dynamic -n > /var/lib/shorewall/save; then
|
||||||
echo " Dynamic Rules Saved"
|
echo " Dynamic Rules Saved"
|
||||||
if [ -f /var/lib/shorewall/restore-new ]; then
|
if [ -f /var/lib/shorewall/restore-base ]; then
|
||||||
mv -f /var/lib/shorewall/restore-new /var/lib/shorewall/restore
|
cp -f /var/lib/shorewall/restore-base /var/lib/shorewall/restore-$$
|
||||||
if iptables-save >> /var/lib/shorewall/restore ; then
|
if iptables-save >> /var/lib/shorewall/restore-$$ ; then
|
||||||
echo EOF >> /var/lib/shorewall/restore
|
echo EOF >> /var/lib/shorewall/restore-$$
|
||||||
|
mv -f /var/lib/shorewall/restore-$$ /var/lib/shorewall/restore
|
||||||
echo " Currently-running Configuration Saved"
|
echo " Currently-running Configuration Saved"
|
||||||
else
|
else
|
||||||
rm -f /var/lib/shorewall/restore
|
rm -f /var/lib/shorewall/restore-$$
|
||||||
echo " ERROR: Currently-running Configuration Not Saved"
|
echo " ERROR: Currently-running Configuration Not Saved"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user