Update temp.inc.sh

This commit is contained in:
2023-12-17 00:11:58 -06:00
parent 5ad044e7ea
commit bf7232dafb

View File

@@ -179,29 +179,20 @@ 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 [ $(bc -l <<< "${temp_probe_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_probe_f} < ${temp_crit}") -eq 1 ]; then
echo -en "${idsCL[Yellow]}WARNING ${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}"
elif [ $(bc -l <<< "${temp_probe_f} >= ${temp_crit}") -eq 1 ]; then
echo -en "${idsCL[LightRed]}CRITICAL${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}"
else
echo -en "${idsCL[Green]}Normal ${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}"
fi
# [ "${average}" != "" ] && echo -en ' '
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
if [ "${average}" == "" ]; then
echo -en "${idsCL[Green]}"
elif [ $(bc -l <<< "${average} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${average} < ${temp_crit}") -eq 1 ]; then
echo -en "${idsCL[Yellow]}${average}"
elif [ $(bc -l <<< "${average} >= ${temp_crit}") -eq 1 ]; then
echo -en "${idsCL[LightRed]}${average}"
else
echo -en "${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
[ "${average}" != "" ] && echo -en "${idsCL[LightRed]}CRITICAL${spct}${temp_probe_f}${GAUGESH} /${spca}${averagedisp}${GAUGESH}${idsCL[Default]}" || echo -en "${idsCL[LightRed]}CRITICAL${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}"
else
[ "${average}" != "" ] && echo -en "${idsCL[Green]}Normal ${spct}${temp_probe_f}${GAUGESH} /${spca}${averagedisp}${GAUGESH}${idsCL[Default]}" || echo -en "${idsCL[Green]}Normal ${spct}${temp_probe_f}${GAUGESH}${idsCL[Default]}"
fi
# [ "${average}" != "" ] && echo -en ' '
echo -e "${spc}[${spcw}${idsCL[Yellow]}${temp_warn}${GAUGESH}${idsCL[Default]} /${spcc}${idsCL[LightRed]}${temp_crit}${GAUGESH}=>${idsCL[Default]} ]"
fi
fi