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 } #