From b8fc127f996474823a459f8f111a3616f91a2101 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 17 Dec 2023 00:20:17 -0600 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 320a4a9a..37958487 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -179,11 +179,19 @@ CHECKTEMPSENSOR(){ [ ${#temp_warn} == 2 ] && spcw=' ' || spcw=' ' [ ${#temp_crit} == 2 ] && spcc=' ' || spcc=' ' echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${1}-Probe ${idsST[Reset]}${spc}${idsCL[Default]}: " - # if [ "${average}" != "" ]; then - # average='' + if [ "${average}" != "" ]; then average=$(AVERAGETEMP ${PW_SENSOR_ID["${1}-Probe"]} ${avgdays}) c=0; spca=''; spc1=`expr 6 - ${#average}`; until [ ${c} = ${spc1} ]; do spca="${spca} "; c=`expr ${c} + 1`; done - # fi + if [ "${average}" == "" ]; then + averagedisp="${idsCL[Green]}" + elif [ $(bc -l <<< "${average} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${average} < ${temp_crit}") -eq 1 ]; then + averagedisp="${idsCL[Yellow]}${average}" + elif [ $(bc -l <<< "${average} >= ${temp_crit}") -eq 1 ]; then + averagedisp="${idsCL[LightRed]}${average}" + else + averagedisp="${idsCL[Green]}${average}" + fi + fi if [ $(bc -l <<< "${temp_probe_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_probe_f} < ${temp_crit}") -eq 1 ]; then [ "${average}" != "" ] && echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_probe_f}${GAUGESH} /${spca}${averagedisp}${GAUGESH}${idsCL[Default]}" || echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}" elif [ $(bc -l <<< "${temp_probe_f} >= ${temp_crit}") -eq 1 ]; then