mirror of
https://gitlab.com/shorewall/code.git
synced 2025-01-24 06:29:03 +01:00
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:
parent
46e306eba9
commit
1fa9316550
@ -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() {
|
fix_bang() {
|
||||||
local i;
|
local i;
|
||||||
|
|
||||||
for i in $@; do
|
for i in $@; do
|
||||||
case $i in
|
case $i in
|
||||||
!*)
|
!*)
|
||||||
@ -165,6 +166,14 @@ fix_bang() {
|
|||||||
# Run iptables and if an error occurs, stop the firewall and quit
|
# Run iptables and if an error occurs, stop the firewall and quit
|
||||||
#
|
#
|
||||||
run_iptables() {
|
run_iptables() {
|
||||||
|
|
||||||
|
if [ "x${*%!*}" = "x$*" ]; then
|
||||||
|
if ! iptables $@ ; then
|
||||||
|
[ -z "$stopping" ] && { stop_firewall; exit 2; }
|
||||||
|
fi
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
if ! iptables `fix_bang $@`; then
|
if ! iptables `fix_bang $@`; then
|
||||||
[ -z "$stopping" ] && { stop_firewall; exit 2; }
|
[ -z "$stopping" ] && { stop_firewall; exit 2; }
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user