Update dsmon.sh
This commit is contained in:
11
dsmon.sh
11
dsmon.sh
@@ -161,7 +161,7 @@ CHECK(){
|
|||||||
nc_count=0; lc_count=0; completed=false; scanstart=$(date +%s)
|
nc_count=0; lc_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
|
||||||
echo -e "\r\r\n"
|
echo -e "\r\r\033[2K\n\033[2K"
|
||||||
|
|
||||||
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}")
|
||||||
@@ -172,14 +172,13 @@ CHECK(){
|
|||||||
[ "${1}" != "report" ] && printf "%s\n" "$(cat /tmp/dscheck.${NTS}.results)"
|
[ "${1}" != "report" ] && printf "%s\n" "$(cat /tmp/dscheck.${NTS}.results)"
|
||||||
rm -f /tmp/dscheck.${NTS}.* >/dev/null 2>&1
|
rm -f /tmp/dscheck.${NTS}.* >/dev/null 2>&1
|
||||||
((nc_count++))
|
((nc_count++))
|
||||||
|
|
||||||
if [ "${1}" != "report" ]; then
|
|
||||||
[ ${nc_count} -gt ${lc_count} ] && echo
|
|
||||||
printf "\r${idsCL[LightCyan]}Completed on %d of %d hosts %s${idsCL[Default]}" "${nc_count}" "${#hostnames_sort[@]}" $([[ "$nc_count" -lt "${#hostnames_sort[@]}" ]] && echo " ..." || echo "")
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "${1}" != "report" ]; then
|
||||||
|
[ ${nc_count} -gt ${lc_count} ] && echo
|
||||||
|
printf "\r${idsCL[LightCyan]}Completed on %d of %d hosts %s${idsCL[Default]}" "${nc_count}" "${#hostnames_sort[@]}" $([[ "$nc_count" -lt "${#hostnames_sort[@]}" ]] && echo " ..." || echo "")
|
||||||
|
fi
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user