Update temp.inc.sh

This commit is contained in:
2024-06-30 13:09:53 -05:00
parent 51ff160657
commit 29e5b80182

View File

@@ -426,18 +426,23 @@ CHECKTEMP(){
c=0; spc=''; spc1=`expr ${cw} - ${#sensorname} - 1`; until [ ${c} = ${spc1} ]; do spc="${spc} "; ((c++)); done
IFS=: read -r temp_f temp_h <<< $(CHECKTEMPSENSOR ${SENSOR}); unset IFS
if [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ] || ([ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} > $(bc <<< "scale=2; ${GL_HIGH}+5")") -eq 1 ]); then
lclr="${idsCL[LightRed]}"
lmd="CRITICAL"
elif ([ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]) || ([ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} > $(bc <<< "scale=2; ${GL_HIGH}")") -eq 1 ]); then
lclr="${idsCL[Yellow]}"
lmd="WARNING "
elif [ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} < ${GL_LOW}") -eq 1 ]; then
lclr="${idsCL[LightCyan]}"
lmd="COOL "
if [ "${TTYPE}" != "fans" ] || ([ "${TTYPE}" == "fans" ] && [[ "${sensorname}" = *"Exhaust"* ]]); then
if [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ] || ([ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} > $(bc <<< "scale=2; ${GL_HIGH}+5")") -eq 1 ]); then
lclr="${idsCL[LightRed]}"
lmd="CRITICAL"
elif ([ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]) || ([ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} > $(bc <<< "scale=2; ${GL_HIGH}")") -eq 1 ]); then
lclr="${idsCL[Yellow]}"
lmd="WARNING "
elif [ "${TTYPE}" == "fans" ] && [ $(bc -l <<< "${temp_f} < ${GL_LOW}") -eq 1 ]; then
lclr="${idsCL[LightCyan]}"
lmd="COOL "
else
lclr="${idsCL[Green]}"
lmd="Normal "
fi
else
lclr="${idsCL[Green]}"
lmd="Normal "
lclr=""
lmd=" "
fi
c=0; spct=''; spc1=`expr 7 - ${#temp_f}`; until [ ${c} = ${spc1} ]; do spct="${spct} "; ((c++)); done
reading="${lclr}${lmd}${spct}${temp_f}${GAUGESH}"