Speed up running of iptables

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@351 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2002-12-05 00:18:47 +00:00
parent 14a20ece71
commit 7a1aa39f95

View File

@ -143,11 +143,29 @@ expandv() # $* = list of variable names
done
}
#
# Replace all "!' with "! " in the passed argument list
#
fix_bang() {
local i;
for i in $@; do
case $i in
!*)
echo "! ${i#!}"
;;
*)
echo $i
;;
esac
done
}
#
# Run iptables and if an error occurs, stop the firewall and quit
#
run_iptables() {
if ! iptables `echo $@ | sed 's/!/! /g'`; then
if ! iptables `fix_bang $@`; then
[ -z "$stopping" ] && { stop_firewall; exit 2; }
fi
}