From f737ec0f9bbc6990122f357b0e826164db4805d8 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 14 Jun 2025 14:43:23 -0500 Subject: [PATCH] Update dsmon.sh --- dsmon.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dsmon.sh b/dsmon.sh index 0dbcc68..9b10f26 100755 --- a/dsmon.sh +++ b/dsmon.sh @@ -148,9 +148,9 @@ CHECK(){ fi started_hosts=0 for hostname in "${hostnames_sort[@]}"; do - # while [ $(jobs -rp | wc -l) -ge 12 ]; do sleep 0.5; done - unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results & - # unbuffer RUN_CHECK "$hostname" > /tmp/dscheck.${hostname}.results & + while [ $(jobs -rp | wc -l) -ge 12 ]; do sleep 0.5; done + # unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results & + unbuffer RUN_CHECK "$hostname" > /tmp/dscheck.${hostname}.results & ((started_hosts++)) [ "${1}" != "report" ] && printf "\r${idsCL[LightCyan]}${MSG}${spc}: Started on %d of %d hosts %s${idsCL[Default]}" "${started_hosts}" "${#hostnames_sort[@]}" $([[ "$started_hosts" -lt "${#hostnames_sort[@]}" ]] && echo " ..." || echo "") @@ -189,7 +189,7 @@ CHECK(){ break fi lc_count=${nc_count} - sleep 1s + # sleep 1s done end=`date +%s`; runtime=$((end-start)); echo -e "\nScript Runtime: ${runtime}s"