From c1bfe7d5b8c918393cf3b5f94c04abd4892496fc Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Mon, 7 Jun 2010 13:55:27 -0700 Subject: [PATCH] More tweaks to saving/restoring dynamic chains Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Compiler.pm | 6 ++---- Shorewall/Perl/prog.footer | 1 + Shorewall/Perl/prog.footer6 | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Compiler.pm b/Shorewall/Perl/Shorewall/Compiler.pm index 0ff445035..fa6d47efb 100644 --- a/Shorewall/Perl/Shorewall/Compiler.pm +++ b/Shorewall/Perl/Shorewall/Compiler.pm @@ -311,7 +311,7 @@ sub save_dynamic_chains() { my $tool = $family == F_IPV4 ? '${IPTABLES}-save' : '${IP6TABLES}-save'; - emit ( 'if [ "$COMMAND" = restart -o "$COMMAND" = restore ]; then' ); + emit ( 'if [ "$COMMAND" = restart -o "$COMMAND" = refresh ]; then' ); push_indent; emit <<"EOF"; @@ -327,7 +327,7 @@ else rm -f \${VARDIR}/.forwardUPnP fi -if [ "\$COMMAND" = restart ] && chain_exists dynamic; then +if chain_exists dynamic; then $tool -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic else rm -f \${VARDIR}/.dynamic @@ -345,8 +345,6 @@ rm -f \${VARDIR}/.forwardUPnP if [ "\$COMMAND" = stop -o "\$COMMAND" = clear ]; then if chain_exists dynamic; then $tool -t filter | grep '^-A dynamic ' > \${VARDIR}/.dynamic - else - rm -f \${VARDIR}/.dynamic fi fi EOF diff --git a/Shorewall/Perl/prog.footer b/Shorewall/Perl/prog.footer index 2f4ff42f9..1abfaf8fb 100644 --- a/Shorewall/Perl/prog.footer +++ b/Shorewall/Perl/prog.footer @@ -218,6 +218,7 @@ case "$COMMAND" in else error_message "$g_product is not running" progress_message3 "Starting $g_product...." + COMMAND=start fi detect_configuration diff --git a/Shorewall/Perl/prog.footer6 b/Shorewall/Perl/prog.footer6 index 99fdd0612..4a32eab04 100644 --- a/Shorewall/Perl/prog.footer6 +++ b/Shorewall/Perl/prog.footer6 @@ -219,6 +219,7 @@ else else error_message "$g_product is not running" progress_message3 "Starting $g_product...." + COMMAND=start fi detect_configuration