diff --git a/Shorewall/firewall b/Shorewall/firewall index c8e4e2d29..efd463c61 100755 --- a/Shorewall/firewall +++ b/Shorewall/firewall @@ -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 }