From c3d412438f10bbdaaed0e47016eb4a55cb5a44e0 Mon Sep 17 00:00:00 2001 From: jc Date: Thu, 19 Jun 2025 07:37:11 +0000 Subject: [PATCH] logical bug fix --- portradar.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/portradar.sh b/portradar.sh index 52d43e2..a53623f 100755 --- a/portradar.sh +++ b/portradar.sh @@ -188,7 +188,7 @@ cidr_to_ips() { # read [[ ! $mask == 24 ]] && [[ $HOST_SCAN == true ]] && { for ((c=0; c<116; c++)); do echo -n "-"; done; echo; } - [[ ! $mask == 24 ]] && { [[ ${live_count["total"]} == 0 ]] && { for i in {1..4}; do UP='\033[1A'; printf "$UP"; done; cg_color bby "Either dead hosts in this subnet or ping is disabled :("; exit; } || { [[ $HOST_SCAN == true ]] && exit || { ips=($(sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 /tmp/ips)); return; }; }; } + [[ ! $mask == 24 ]] && { [[ ${live_count["total"]} == 0 ]] && { [[ $HOST_SCAN == true ]] && { for i in {1..4}; do UP='\033[1A'; printf "$UP"; done; }; cg_color bby "Either dead hosts in this subnet or ping is disabled :("; exit; } || { [[ $HOST_SCAN == true ]] && exit || { ips=($(sort -t. -n -k1,1 -k2,2 -k3,3 -k4,4 /tmp/ips)); return; }; }; } [[ -f /tmp/ips ]] && ips=($(sort -t. -n -k +4 /tmp/ips)) || { cg_color bby "Either dead hosts in this subnet or ping is disabled :("; exit; } [[ $HOST_SCAN == true ]] && { out=${ips[*]}; l="\n"; echo -n "Number of live hosts: "; cg_color bbb ${#ips[@]}; echo -e "\e[1;92m${out//${IFS:0:1}/$l}\e[0m"; exit; } || return } @@ -275,4 +275,4 @@ elif [[ $cidr ]]; then [[ ($RUN_NMAP == true) && -f /tmp/tcp_ports ]] && echo cl done -fi \ No newline at end of file +fi