changed how it prints the live hosts

This commit is contained in:
Collins Gitahi
2024-10-16 18:46:13 +03:00
parent 2159e2705e
commit a482012a34
+3 -3
View File
@@ -165,8 +165,8 @@ cidr_to_ips() {
wait
# read
[[ -f /tmp/ips ]] && ips=($(</tmp/ips)) || { cg_color bby "Either dead hosts in this subnet or ping is disabled :("; exit; }
[[ $HOST_SCAN == true ]] && { echo -e "\e[1;92m${ips[*]}\e[0m"; exit; }
[[ -f /tmp/ips ]] && ips=($(sort -t. -n +3 /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; }
}
# Syntax
@@ -231,4 +231,4 @@ elif [[ $cidr ]]; then
[[ ($RUN_NMAP == true) && -f /tmp/tcp_ports ]] && echo
cl
done
fi
fi