From 01a1f8d7f8ab5061d9ebe9f44b5ef60ae0ca74a2 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 25 Nov 2023 23:40:43 -0600 Subject: [PATCH] Update status.inc --- inc/status.inc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/inc/status.inc b/inc/status.inc index 39fe8c00..d5e86cb2 100755 --- a/inc/status.inc +++ b/inc/status.inc @@ -195,16 +195,13 @@ STATUS(){ DIVIDER false lightCyan fi if [ -f ${NM_TMPFOLDER}/${nip}.down ]; then - if [ -f ${NM_TMPFOLDER}/${nip}.errtime ]; then - toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.errtime) - else - toterrtime=`date +%s`-$(stat -c %Y ${NM_TMPFOLDER}/${nip}.down) + if [ -f ${NM_TMPFOLDER}/${nip}.sent ]; then + [ -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) + SENDNOTICE "${NM_HOSTNAMES[${nip}]}[${nip}]-UP" "${NM_HOSTNAMES[${nip}]}[${nip}] is back UP! It was down for $(SHOW_TIME ${toterrtime})" fi 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 - ######################## ## SERVICES CHECK ######################## @@ -411,6 +408,7 @@ STATUS(){ fi fi touch ${NM_TMPFOLDER}/${nip}.down + touch ${NM_TMPFOLDER}/${nip}.sent fi fi