Update dsmon.sh

This commit is contained in:
2025-06-14 13:15:11 -05:00
parent 196c1e2288
commit 554cf38956

View File

@@ -147,8 +147,12 @@ CHECK(){
echo -en "${idsCL[LightCyan]}${MSG}${spc}: "
fi
for hostname in "${hostnames_sort[@]}"; do
until [ $(ls /tmp/dscheck.*.running 2>/dev/null | wc -l) -lt 2 ]; do tmp=tmp; done
unbuffer bash -c "/usr/local/bin/dsmon runcheck '${hostname}'" > /tmp/dscheck.${hostname}.results &
# until [ $(ls /tmp/dscheck.*.running 2>/dev/null | wc -l) -lt 2 ]; do tmp=tmp; done
while [ "$(jobs -rp | wc -l)" -ge "2" ]; 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 &
done
[ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}"