Update dsmon.sh

This commit is contained in:
2025-06-14 13:22:34 -05:00
parent aca1140c8d
commit 1dc33abd79

View File

@@ -147,9 +147,10 @@ CHECK(){
echo -en "${idsCL[LightCyan]}${MSG}${spc}: "
fi
for hostname in "${hostnames_sort[@]}"; do
# while [ $(jobs -rp | wc -l) -ge 12 ]; do sleep 0.5; done
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 &
printf "\rRunning: %d/%d hosts..." "$(jobs -rp | wc -l)" "${#hostnames_sort[@]}"
done
[ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}"
@@ -169,7 +170,6 @@ CHECK(){
((nc_count++))
fi
done
printf "\rRunning: %d/%d hosts..." "$(jobs -rp | wc -l)" "${#hostnames_sort[@]}"
if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
SENDNOTICE "DSmon Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1