Update status.inc

This commit is contained in:
2023-11-25 23:40:43 -06:00
parent 0d6d5d2f86
commit 01a1f8d7f8

View File

@@ -195,16 +195,13 @@ STATUS(){
DIVIDER false lightCyan DIVIDER false lightCyan
fi fi
if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then
if [ -f ${NM_TMPFOLDER}/${nip}.errtime ]; then if [ -f ${NM_TMPFOLDER}/${nip}.sent ]; then
toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) [ -f ${NM_TMPFOLDER}/${nip}.errtime ] && toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) || toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)
else SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]-UP" "${NM_HOSTNAMES[${nip}]}[${nip}] is back UP! It was down for $(SHOW_TIME ${toterrtime})"
toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down)
fi fi
rm -f ${NM_TMPFOLDER}/${nip}.* rm -f ${NM_TMPFOLDER}/${nip}.*
SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]-UP" "${NM_HOSTNAMES[${nip}]}[${nip}] is back UP! It was down for $(SHOW_TIME ${toterrtime})"
fi fi
######################## ########################
## SERVICES CHECK ## SERVICES CHECK
######################## ########################
@@ -411,6 +408,7 @@ STATUS(){
fi fi
fi fi
touch ${NM_TMPFOLDER}/${nip}.down touch ${NM_TMPFOLDER}/${nip}.down
touch ${NM_TMPFOLDER}/${nip}.sent
fi fi
fi fi