summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérôme Schneider <jschneider@entrouvert.com>2013-08-30 17:41:20 (GMT)
committerJérôme Schneider <jschneider@entrouvert.com>2013-08-30 17:41:20 (GMT)
commit11827cd6d1c02f8f182d70c4246a05df8a70d805 (patch)
treef2322f6d7173b060c9be8d8dbc179b94a81b5ea5
parentbb7b95c78d45a7a1531540aaa043d9a0134a7cb7 (diff)
downloadeofirewall-11827cd6d1c02f8f182d70c4246a05df8a70d805.zip
eofirewall-11827cd6d1c02f8f182d70c4246a05df8a70d805.tar.gz
eofirewall-11827cd6d1c02f8f182d70c4246a05df8a70d805.tar.bz2
firewall: use multiports instead of openning port by port
-rwxr-xr-xfirewall6
1 files changed, 2 insertions, 4 deletions
diff --git a/firewall b/firewall
index f24503d..444acdf 100755
--- a/firewall
+++ b/firewall
@@ -109,10 +109,8 @@ open_port()
fi
source=$1
log_action_msg "Open port(s) $ports from $source to $destination for protocol $proto"
- for port in $(echo $ports | sed 's/,/ /g'); do
- $IPTABLES -A INPUT -i $WAN_INT -p $proto -s $source -d $destination --dport $port -m state --state NEW -j ACCEPT
- critical_return
- done
+ $IPTABLES -A INPUT -i $WAN_INT -p $proto -s $source -d $destination -m multiport --dports $ports -m state --state NEW -j ACCEPT
+ critical_return
}
port_redirection()