Update temp.inc.sh

This commit is contained in:
2023-12-29 21:24:09 -06:00
parent 055626f458
commit da891b3afd

View File

@@ -626,10 +626,10 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
if [ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] || [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.log.sr.difference)) -ge 3 ]; then
if [ "${temp_f}" != "" ] && (( $(bc <<< "${temp_f} >= 2") )) && [ -f ${PW_TMPFOLDER}/.serverroomth ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.serverroomth)) -lt 30 ]; then
[ ! -f ${PW_TMPFOLDER}/.log.sr.difference ] && touch ${PW_TMPFOLDER}/.log.sr.difference
temp_difference=$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.serveroomth)-${temp_f}")
temp_difference=$(bc <<< "scale=2; $(cat ${PW_TMPFOLDER}/.serverroomth)-${temp_f}")
# (( $(bc <<<"${temp_difference} < 0") )) && temp_difference=`echo "scale=2; ${temp_difference} * -1" | bc`
echo "$(date "+%Y-%m-%d %H:%M:%S")~${temp_difference}" >> ${PW_TMPFOLDER}/.log.sr.difference
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - $(cat ${PW_TMPFOLDER}/.serveroomth) = ${temp_difference}"
echo "[$(date +'%Y-%m-%d %H:%M:%S')] ${temp_f} - $(cat ${PW_TMPFOLDER}/.serverroomth) = ${temp_difference}"
rm -f ${PW_TMPFOLDER}/.serverroomth
fi
fi