Fixes for multiport
parent
9f0398421a
commit
d687925d1f
|
@ -267,7 +267,7 @@ if [ "$TCPPORTS" ] || [ "$UDPPORTS" ]; then
|
||||||
PORTS_COUNT=${#TCPPORTS[@]}
|
PORTS_COUNT=${#TCPPORTS[@]}
|
||||||
PORTS_COUNT_CURR=0
|
PORTS_COUNT_CURR=0
|
||||||
while [[ $PORTS_COUNT_CURR < $PORTS_COUNT ]]; do
|
while [[ $PORTS_COUNT_CURR < $PORTS_COUNT ]]; do
|
||||||
for ((i=$PORTS_COUNT_CURR; i <=(($PORTS_COUNT_CURR+(($MULTI_MAX_PORTS-1)))); i++)); do
|
for ((i=$PORTS_COUNT_CURR; i <=(($PORTS_COUNT_CURR+(($NF_MULTI_MAX_PORTS-1)))); i++)); do
|
||||||
if [ ${TCPPORTS[$i]} ]; then
|
if [ ${TCPPORTS[$i]} ]; then
|
||||||
PORTS="${PORTS},${TCPPORTS[$i]}"
|
PORTS="${PORTS},${TCPPORTS[$i]}"
|
||||||
fi
|
fi
|
||||||
|
@ -570,15 +570,15 @@ if [ $IPV6 ]; then
|
||||||
PORTS_COUNT=${#IPV6TCP[@]}
|
PORTS_COUNT=${#IPV6TCP[@]}
|
||||||
PORTS_COUNT_CURR=0
|
PORTS_COUNT_CURR=0
|
||||||
while [[ $PORTS_COUNT_CURR < $PORTS_COUNT ]]; do
|
while [[ $PORTS_COUNT_CURR < $PORTS_COUNT ]]; do
|
||||||
for ((i=$PORTS_COUNT_CURR; i <=(($PORTS_COUNT_CURR+(($MULTI_MAX_PORTS-1)))); i++)); do
|
for ((i=$PORTS_COUNT_CURR; i <=(($PORTS_COUNT_CURR+(($NF_MULTI_MAX_PORTS-1)))); i++)); do
|
||||||
if [ ${IPV6TCP[$i]} ]; then
|
if [ ${IPV6TCP[$i]} ]; then
|
||||||
PORTS="${PORTS},${IPV6TCP[$i]}"
|
PORTS="${PORTS},${IPV6TCP[$i]}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo -en "${PURPLE}Multiport-TCP${DEFAULT_COLOR}/${GREEN}${PORTS#,}"
|
echo -en "${PURPLE}Multiport-TCP${DEFAULT_COLOR}/${GREEN}${PORTS#,}"
|
||||||
$IPTABLES -A INPUT -p tcp -m multiport --dports ${PORTS#,} -j ACCEPT
|
$IP6TABLES -A INPUT -p tcp -m multiport --dports ${PORTS#,} -j ACCEPT
|
||||||
unset PORTS
|
unset PORTS
|
||||||
PORTS_COUNT_CURR=$y
|
PORTS_COUNT_CURR=$i
|
||||||
done
|
done
|
||||||
unset y PORTS PORTS_COUNT_CURR PORTS_COUNT
|
unset y PORTS PORTS_COUNT_CURR PORTS_COUNT
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue