Update temp.inc.sh

This commit is contained in:
2024-05-09 21:00:31 -05:00
parent e5b179570f
commit e780526cf3

View File

@@ -216,10 +216,10 @@ CHECKTEMP(){
if [ ${DETAILS} -eq 1 ]; then
for M in 15 30 60 120; do
lico=" "
OLD_temp_f=($(${mysql_conn} -e "SELECT temp FROM servermonitor.sensor_data WHERE sensorid='${PW_SENSOR_ID[${SENSOR}]}' AND date >= DATE_SUB(NOW(), INTERVAL ${M} MINUTE) AND date <= DATE_SUB(NOW(), INTERVAL $(expr ${M} - 7) MINUTE) ORDER BY date ASC LIMIT 1"))
if [ $(bc -l <<< "${temp_f} < $(echo "scale=2; ${OLD_temp_f[1]}+${PW_TEMPIND_DIFF}" | bc)") -eq 1 ] && [ $(bc -l <<< "$(echo "scale=2; ${OLD_temp_f[1]}-${PW_TEMPIND_DIFF}" | bc) < ${temp_f}") -eq 1 ]; then
lclr="${idsCL[White]}"
lico=" "
elif [ $(bc -l <<< "$(bc <<< "scale=2; ${OLD_temp_f[1]}+(${PW_TEMPIND_DIFF}*2)") < ${temp_f}") -eq 1 ]; then
lclr="${idsCL[LightRed]}"
lico="\u25B2"
@@ -234,7 +234,6 @@ CHECKTEMP(){
lico="\u25BC"
else
lclr="${idsCL[Default]}"
lico=" "
fi
([ "${temp_h}" != "" ] && [ "${temp_h}" != "0" ]) && echo -en "${idsCL[White]}| " || echo -n " "
[ ${#M} -eq 2 ] && echo -n " "