From 41ebd30e99e3cb9dfe3f89d8f8c468994d0a1068 Mon Sep 17 00:00:00 2001 From: bbruns Date: Sun, 26 Sep 2010 21:35:29 +0000 Subject: [PATCH] Fixes for multiport --- bin/firewall-sosdg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/firewall-sosdg b/bin/firewall-sosdg index c356b7f..1973cfe 100755 --- a/bin/firewall-sosdg +++ b/bin/firewall-sosdg @@ -263,13 +263,13 @@ if [ "$TCPPORTS" ] || [ "$UDPPORTS" ]; then display_c YELLOW "Adding allowed port: " N if [ "$TCPPORTS" ]; then if [ $IPTABLES_MULTIPORT == "yes" ] && [ $NF_MULTIPORT_MAX_PORTS ]; then - TCPPORTS=($TCPPORTS) + TCPPORTS_ARRAY=($TCPPORTS) PORTS_COUNT=${#TCPPORTS[@]} PORTS_COUNT_CURR=0 while [ $PORTS_COUNT_CURR -lt $PORTS_COUNT ]; do for ((y=$PORTS_COUNT_CURR; y <=(($PORTS_COUNT_CURR+((MULTI_MAX_PORTS-1)))); y++)); do - if [ ${TCPPORTS[$y]} ]; then - PORTS="$PORTS,${TCPPORTS[$y]}" + if [ ${TCPPORTS_ARRAY[$y]} ]; then + PORTS="${PORTS},${TCPPORTS_ARRAY[$y]}" fi done echo -en "${PURPLE}Multiport-TCP${DEFAULT_COLOR}/${GREEN}${PORTS#,}" @@ -565,7 +565,7 @@ if [ $IPV6 ]; then if [ "$IPV6TCP" ] || [ "$IPV6UDP" ]; then display_c YELLOW "Adding allowed IPv6 port: " N if [ "$IPV6TCP" ]; then - if [ $IPTABLES_MULTIPORT == "yes" ]; then + if [ $IPTABLES_MULTIPORT == "yes" ] && [ $NF_MULTIPORT_MAX_PORTS ]; then IPV6TCP=($IPV6TCP) PORTS_COUNT=${#IPV6TCP[@]} PORTS_COUNT_CURR=0