From d5ebc8aad5302af7777107c71357f4062f5b050e Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 22 Dec 2023 20:03:35 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 934b29a7..84c9480f 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -516,12 +516,14 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}" ################### else - if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then - touch ${PW_TMPFOLDER}/${SENSOR}.down + [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ] && touch ${PW_TMPFOLDER}/${SENSOR}.down + if [ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.reading ]; then touch ${PW_TMPFOLDER}/${SENSOR}-error.reading + elif [ ! -f ${PW_TMPFOLDER}/${SENSOR}.disable ] && ([ ! -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.reading)) -ge 60 ]) || ([ -f ${PW_TMPFOLDER}/${SENSOR}-error.sent ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/${SENSOR}-error.sent)) -ge $(echo "scale=0; ${PW_RENOTIFY_TIMEOUT}*60" | bc) ]); then SENDNOTICE "${SENSOR} Sensor ERROR" "ERROR reading sensor data" 1 - echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading host data" >> ${logtemp} - fi + echo "($(date +'%Y-%m-%d %H:%M:%S')) - ${SENSOR} Sensor - ERROR reading sensor data" >> ${logtemp} + touch ${PW_TMPFOLDER}/${SENSOR}-error.sent + fi fi done fi