logical bug fix

This commit is contained in:
jc
2025-06-19 07:37:11 +00:00
parent 2a270fef73
commit c3d412438f
+2 -2
View File
@@ -188,7 +188,7 @@ cidr_to_ips() {
# read # read
[[ ! $mask == 24 ]] && [[ $HOST_SCAN == true ]] && { for ((c=0; c<116; c++)); do echo -n "-"; done; echo; } [[ ! $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; } [[ -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 [[ $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 [[ ($RUN_NMAP == true) && -f /tmp/tcp_ports ]] && echo
cl cl
done done
fi fi