Checking COUNTER variables if their value are zero, chnaging to one.
This commit is contained in:
@@ -84,21 +84,25 @@ COUNT_SOURCE_PORT=$(set |grep SOURCE_PORT |wc -l)
|
||||
COUNT_TARGET_IP=$(set |grep TARGET_IP |wc -l)
|
||||
COUNT_TARGET_PORT=$(set |grep TARGET_PORT |wc -l)
|
||||
|
||||
if [ "$COUNT_SOURCE_IP" == 0 ] ; then COUNT_SOURCE_IP=1 ; fi
|
||||
for source_ip_index in $(seq 1 $COUNT_SOURCE_IP) ; do
|
||||
if set |grep SOURCE_IP_ ; then
|
||||
SOURCE_IP=$(eval "echo \${"SOURCE_IP_$source_ip_index"}")
|
||||
fi
|
||||
|
||||
|
||||
if [ "$COUNT_SOURCE_PORT" == 0 ] ; then COUNT_SOURCE_PORT=1 ; fi
|
||||
for source_port_index in $(seq 1 $COUNT_SOURCE_PORT) ; do
|
||||
if set |grep SOURCE_PORT_ ; then
|
||||
SOURCE_PORT=$(eval "echo \${"SOURCE_PORT_$source_port_index"}")
|
||||
fi
|
||||
|
||||
if [ "$COUNT_TARGET_IP" == 0 ] ; then COUNT_TARGET_IP=1 ; fi
|
||||
for target_ip_index in $(seq 1 $COUNT_TARGET_IP) ; do
|
||||
if set |grep TARGET_IP_ ; then
|
||||
TARGET_IP=$(eval "echo \${"TARGET_IP_$target_ip_index"}")
|
||||
fi
|
||||
|
||||
if [ "$COUNT_TARGET_PORT" == 0 ] ; then COUNT_TARGET_PORT=1 ; fi
|
||||
for target_port_index in $(seq 1 $COUNT_TARGET_PORT) ; do
|
||||
if set |grep TARGET_PORT_ ; then
|
||||
TARGET_PORT=$(eval "echo \${"TARGET_PORT_$target_port_index"}")
|
||||
|
Reference in New Issue
Block a user