From 22fd72cfadbbc99aa35ee7d1156ec51f2c6b48c5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Tue, 23 Apr 2024 14:02:26 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 759ebb54..c5a7e732 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -1057,12 +1057,11 @@ Previous Temp: ${last_temp}${GAUGESH}" #### TRACKING TEMP CHANGES if [ "${temp_f}" != "" ] && [[ "${SENSOR}" != *"CPU-Usage"* ]] && [[ "${SENSOR}" != *"FAN"* ]]; then if [ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ]; then - echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre + [ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre - elif ([ ! -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre)) -ge 1800 ]) || ([ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old)) -ge 1800 ]); then + elif [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre)) -ge 1800 ]; then [ -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ] && mv -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old2 mv -f ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.old - sleep 1s echo "${temp_f}" > ${PW_TMPFOLDER}/.lastinsert/${SENSOR}.pre fi