Update dsmon.sh

This commit is contained in:
2025-06-13 21:19:25 -05:00
parent 1b26abeda3
commit 53fdf50207

View File

@@ -143,13 +143,12 @@ CHECK(){
nc_count=0; completed=false; scanstart=$(date +%s) nc_count=0; completed=false; scanstart=$(date +%s)
until [ "${completed}" == "true" ]; do until [ "${completed}" == "true" ]; do
# until [ $(ls /tmp/dscheck.*.done 2>/dev/null | wc -l) -gt 0 ]; do tmp=tmp; done until [ $(ls /tmp/dscheck.*.done 2>/dev/null | wc -l) -gt 0 ]; do tmp=tmp; done
for host in /tmp/dscheck.*.done; do for host in /tmp/dscheck.*.done; do
NTS=$(grep -oP '(?<=dscheck.).*?(?=.done)' <<< "${host}") NTS=$(grep -oP '(?<=dscheck.).*?(?=.done)' <<< "${host}")
if [ "${NTS}" != "*" ]; then if [ "${NTS}" != "*" ]; then
echo -e "$(cat /tmp/dscheck.${NTS}.results)" echo -e "$(cat /tmp/dscheck.${NTS}.results)"
cp -f /tmp/dscheck.${NTS}.results /tmp/${NTS}.result rm -f /tmp/dscheck.${NTS}.* >/dev/null 2>&1
rm -f /tmp/dscheck.${NTS}.*
((nc_count++)) ((nc_count++))
fi fi
done done