Update temp.inc.sh

This commit is contained in:
2023-12-22 20:03:35 -06:00
parent 8c6765880a
commit d5ebc8aad5

View File

@@ -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