From 5660b6fa1f205439204274c0e597c3d8d6660f66 Mon Sep 17 00:00:00 2001 From: teastep Date: Tue, 27 Nov 2007 18:51:53 +0000 Subject: [PATCH] Fix status checking git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7777 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/prog.functions | 12 +++++++++--- Shorewall-perl/prog.header | 7 ++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Shorewall-perl/prog.functions b/Shorewall-perl/prog.functions index 5d10cd0ad..372687f7c 100644 --- a/Shorewall-perl/prog.functions +++ b/Shorewall-perl/prog.functions @@ -103,12 +103,15 @@ startup_error() # $* = Error Message # run_iptables() { + local status + while [ 1 ]; do $IPTABLES $@ - [ $? -ne 4 ] && break + status=$? + [ $status -ne 4 ] && break done - if [ $? -ne 0 ]; then + if [ $status -ne 0 ]; then error_message "ERROR: Command \"$IPTABLES $@\" Failed" stop_firewall exit 2 @@ -120,9 +123,12 @@ run_iptables() # do_iptables() { + local status + while [ 1 ]; do $IPTABLES $@ - [ $? -ne 4 ] && break + status=$? + [ $status -ne 4 ] && return $status; done } diff --git a/Shorewall-perl/prog.header b/Shorewall-perl/prog.header index 2162b8062..31ca2c0c1 100644 --- a/Shorewall-perl/prog.header +++ b/Shorewall-perl/prog.header @@ -114,10 +114,15 @@ qt() qt1() { + local status + while [ 1 ]; do "$@" >/dev/null 2>&1 - [ $? -ne 4 ] && break; + status=$? + [ $status -ne 4 ] && break done + + return $status } #