Update dsmon.sh

This commit is contained in:
2025-06-14 13:28:22 -05:00
parent 56cf676cc8
commit 19507a91c6

View File

@@ -152,10 +152,10 @@ CHECK(){
unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results &
# unbuffer RUN_CHECK "$hostname" > /tmp/dscheck.${hostname}.results &
((started_hosts++))
printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d/%d hosts ..." "${started_hosts}" "${#hostnames_sort[@]}"
printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d of %d hosts ..." "${started_hosts}" "${#hostnames_sort[@]}"
done
[ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}"
[ "${1}" != "report" ] && echo -e "\r${idsCL[LightCyan]}${MSG}${spc}: Done${idsCL[Default]}"
sleep 2
shopt -s nullglob
nc_count=0; completed=false; scanstart=$(date +%s)
until [ "${completed}" == "true" ]; do
@@ -163,7 +163,6 @@ CHECK(){
for host in /tmp/dscheck.*.done; do
NTS=$(grep -oP '(?<=dscheck\.).*?(?=\.done)' <<< "${host}")
if [ -n "$NTS" ]; then
echo "'$host' = '$NTS'"
while IFS= read -r line; do
printf "%s\n" "$line"
done < /tmp/dscheck.${NTS}.results