Fix status checking

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@7777 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-11-27 18:51:53 +00:00
parent 2534c13104
commit 5660b6fa1f
2 changed files with 15 additions and 4 deletions

View File

@ -103,12 +103,15 @@ startup_error() # $* = Error Message
# #
run_iptables() run_iptables()
{ {
local status
while [ 1 ]; do while [ 1 ]; do
$IPTABLES $@ $IPTABLES $@
[ $? -ne 4 ] && break status=$?
[ $status -ne 4 ] && break
done done
if [ $? -ne 0 ]; then if [ $status -ne 0 ]; then
error_message "ERROR: Command \"$IPTABLES $@\" Failed" error_message "ERROR: Command \"$IPTABLES $@\" Failed"
stop_firewall stop_firewall
exit 2 exit 2
@ -120,9 +123,12 @@ run_iptables()
# #
do_iptables() do_iptables()
{ {
local status
while [ 1 ]; do while [ 1 ]; do
$IPTABLES $@ $IPTABLES $@
[ $? -ne 4 ] && break status=$?
[ $status -ne 4 ] && return $status;
done done
} }

View File

@ -114,10 +114,15 @@ qt()
qt1() qt1()
{ {
local status
while [ 1 ]; do while [ 1 ]; do
"$@" >/dev/null 2>&1 "$@" >/dev/null 2>&1
[ $? -ne 4 ] && break; status=$?
[ $status -ne 4 ] && break
done done
return $status
} }
# #