From b58146d4d9fc0d596ac8b7b1bc742135d0db96aa Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 17 Dec 2023 11:34:45 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index e2225af8..93b35ddc 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -615,6 +615,7 @@ SERVERROOM_TEMP_DIFFERENCE(){ last_tempdiff=$(tail -n 1 ${PW_TMPFOLDER}/.log.sr.difference) last_tempdiff=${last_tempdiff#*~} + [ ${last_tempdiff} -lt 1 ] && last_tempdiff="0${last_tempdiff}" tempdiffs=$(tail -n ${LAST} ${PW_TMPFOLDER}/.log.sr.difference) largest_tempdiff=0 IFS=$'\n' @@ -627,11 +628,10 @@ SERVERROOM_TEMP_DIFFERENCE(){ tempdiff_total=$(bc <<< "scale=2; ${tempdiff_total}+${tempdiff}") ((scansfound++)) done + [ ${largest_tempdiff} -lt 1 ] && largest_tempdiff="0${largest_tempdiff}" [ ${scansfound} -eq 0 ] && average=0 || average=$(bc <<< "scale=2; ${tempdiff_total}/${scansfound}") - - last_tempdiff_disp=$(SHOW_TIME ${last_tempdiff} s) - largest_tempdiff_disp=$(SHOW_TIME ${largest_tempdiff} s) + [ ${average} -lt 1 ] && average="0${average}" [ -f ${PW_TMPFOLDER}/.log.sr.difference ] && last_scancheck=$(date -d @$(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference) "+%Y-%m-%d %H:%M:%S") || last_scancheck=""