From 9598ac6fadebd9f35eeaf0941df3ffb0e0bc286e Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Sat, 1 Nov 2014 10:09:04 -0700 Subject: [PATCH] Correct a couple of problems with -C Signed-off-by: Tom Eastep --- Shorewall-core/lib.cli | 10 ++++++---- Shorewall/Perl/Shorewall/Chains.pm | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Shorewall-core/lib.cli b/Shorewall-core/lib.cli index 9a56cff37..b86940312 100644 --- a/Shorewall-core/lib.cli +++ b/Shorewall-core/lib.cli @@ -493,7 +493,7 @@ save_config() { [ -x $iptables_save ] || echo "$iptables-save does not exist or is not executable" >&2 - [ -n "$g_counters" iptables_save="$iptables_save --counters" + [ -n "$g_counters" ] && iptables_save="$iptables_save --counters" if product_is_started ; then [ -d ${VARDIR} ] || mkdir -p ${VARDIR} @@ -3122,6 +3122,8 @@ save_command() { local finished finished=0 + shift + while [ $finished -eq 0 -a $# -gt 0 ]; do option=$1 case $option in @@ -3152,10 +3154,10 @@ save_command() { done case $# in - 1) + 0) ;; - 2) - RESTOREFILE="$2" + 1) + RESTOREFILE="$1" validate_restorefile '' ;; *) diff --git a/Shorewall/Perl/Shorewall/Chains.pm b/Shorewall/Perl/Shorewall/Chains.pm index cd2927ef5..6d59dc9c2 100644 --- a/Shorewall/Perl/Shorewall/Chains.pm +++ b/Shorewall/Perl/Shorewall/Chains.pm @@ -8243,7 +8243,7 @@ sub create_netfilter_load( $ ) { '# Create the input to iptables-restore/ip6tables-restore and pass that input to the utility', '#', 'setup_netfilter()', - '{'. + '{', ' local option', ); @@ -8309,8 +8309,8 @@ sub create_netfilter_load( $ ) { # SHA1SUM chains for handling 'restart -s' # if ( $table eq 'filter' ) { - emit_unindented ':$shasum1 - [0:0]'; - emit_unindented ':$shasum2 - [0:0]'; + emit_unindented ':$g_sha1sum1 - [0:0]'; + emit_unindented ':$g_sha1sum2 - [0:0]'; } #