forked from extern/shorewall_code
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:
parent
14a20ece71
commit
7a1aa39f95
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user