mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-15 04:04:10 +01:00
Include iptables-save output in /var/lib/shorewall/restore
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@1289 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
e11652b86a
commit
0ec2b0210c
@ -1194,7 +1194,7 @@ stop_firewall() {
|
||||
;;
|
||||
*)
|
||||
set +x
|
||||
if [ -f /var/lib/shorewall/restore -a -f /var/lib/shorewall/iptsave ]; then
|
||||
if [ -f /var/lib/shorewall/restore ]; then
|
||||
echo Restoring Shorewall...
|
||||
. /var/lib/shorewall/restore
|
||||
echo Shorewall restored
|
||||
@ -5341,21 +5341,22 @@ define_firewall() # $1 = Command (Start or Restart)
|
||||
|
||||
date > $STATEDIR/restarted
|
||||
|
||||
save_command "date > $STATEDIR/restarted"
|
||||
|
||||
report "Shorewall ${1}ed"
|
||||
|
||||
rm -rf $TMP_DIR
|
||||
|
||||
save_command "iptables-restore < /var/lib/shorewall/iptsave"
|
||||
|
||||
for file in chains nat proxyarp zones; do
|
||||
append_file $file
|
||||
done
|
||||
|
||||
save_command "date > $STATEDIR/restarted"
|
||||
|
||||
save_command 'iptables-restore << EOF'
|
||||
|
||||
mv -f /var/lib/shorewall/restore-$$ /var/lib/shorewall/restore-new
|
||||
|
||||
chmod +x /var/lib/shorewall/restore-new
|
||||
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -730,7 +730,7 @@ case "$1" in
|
||||
[ $# -ne 1 ] && usage 1
|
||||
get_config
|
||||
if [ -n "$FAST" ]; then
|
||||
if [ -f /var/lib/shorewall/restore -a -f /var/lib/shorewall/iptsave ]; then
|
||||
if [ -f /var/lib/shorewall/restore ]; then
|
||||
echo Restoring Shorewall...
|
||||
. /var/lib/shorewall/restore
|
||||
date > $STATEDIR/restarted
|
||||
@ -966,9 +966,15 @@ case "$1" in
|
||||
|
||||
if iptables -L dynamic -n > /var/lib/shorewall/save; then
|
||||
echo " Dynamic Rules Saved"
|
||||
if iptables-save > /var/lib/shorewall/iptsave; then
|
||||
if [ -f /var/lib/shorewall/restore-new ]; then
|
||||
mv -f /var/lib/shorewall/restore-new /var/lib/shorewall/restore
|
||||
echo "Last Started Configuration Saved"
|
||||
if iptables-save >> /var/lib/shorewall/restore ; then
|
||||
echo EOF >> /var/lib/shorewall/restore
|
||||
echo " Currently-running Configuration Saved"
|
||||
else
|
||||
rm -f /var/lib/shorewall/restore
|
||||
echo " ERROR: Currently-running Configuration Not Saved"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "Error Saving the Dynamic Rules"
|
||||
|
Loading…
Reference in New Issue
Block a user