Yet another speed improvement

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@357 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2002-12-09 02:42:28 +00:00
parent 46e306eba9
commit 1fa9316550

View File

@ -144,11 +144,12 @@ expandv() # $* = list of variable names
}
#
# Replace all "!' with "! " in the passed argument list
# Replace all leading "!" with "! " in the passed argument list
#
fix_bang() {
local i;
for i in $@; do
case $i in
!*)
@ -165,6 +166,14 @@ fix_bang() {
# Run iptables and if an error occurs, stop the firewall and quit
#
run_iptables() {
if [ "x${*%!*}" = "x$*" ]; then
if ! iptables $@ ; then
[ -z "$stopping" ] && { stop_firewall; exit 2; }
fi
return
fi
if ! iptables `fix_bang $@`; then
[ -z "$stopping" ] && { stop_firewall; exit 2; }
fi