Update dsmon.sh

This commit is contained in:
2025-06-13 21:00:17 -05:00
parent 63858fc98a
commit fd2035ce64

View File

@@ -141,30 +141,30 @@ CHECK(){
done done
[ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n" [ "${1}" != "report" ] && echo -e "${idsCL[LightGreen]}Done${idsCL[Default]}\n"
# 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
# hoststatus=$(cat /tmp/dscheck.${NTS}.results) hoststatus="$(cat /tmp/dscheck.${NTS}.results)"
# [ "${hoststatus}" != "" ] && echo -e "${hoststatus}" [ "${hoststatus}" != "" ] && echo -e "${hoststatus}"
# #rm -f /tmp/dscheck.${NTS}.* rm -f /tmp/dscheck.${NTS}.*
# ((nc_count++)) ((nc_count++))
# fi fi
# done done
# if [ $(($(date +%s)-scanstart)) -gt 300 ]; then if [ $(($(date +%s)-scanstart)) -gt 300 ]; then
# SENDNOTICE "DSmon Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1 SENDNOTICE "DSmon Scan Stuck" "DSmon Check scan has been running for 10mins, klling all bash...." 1
# killall bash killall bash
# pw service all restart pw service all restart
# exit 1 exit 1
# fi fi
# if [ ${nc_count} -eq ${#hostnames_sort[@]} ]; then if [ ${nc_count} -eq ${#hostnames_sort[@]} ]; then
# completed=true completed=true
# break break
# fi fi
# sleep 1s sleep 1s
# done done
end=`date +%s`; runtime=$((end-start)); echo -e "\nScript Runtime: ${runtime}" end=`date +%s`; runtime=$((end-start)); echo -e "\nScript Runtime: ${runtime}"
echo echo