Update temp.inc.sh

This commit is contained in:
2024-02-24 23:14:16 -06:00
parent b94ce49545
commit 0000cd67ee

View File

@@ -110,20 +110,28 @@ CHECKTEMP(){
echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... " echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... "
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
temp_f=$(CHECKTEMPSENSOR ${SENSOR}) temp_f=$(CHECKTEMPSENSOR ${SENSOR})
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && temp_f_disp=$(IDS_NUMBER_FORMAT ${temp_f} 0) || temp_f_disp=${temp_f} if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && temp_f_disp=$(IDS_NUMBER_FORMAT ${temp_f} 0) || temp_f_disp=${temp_f}
lclr="${idsCL[Yellow]}" if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
lmd="WARNING " lclr="${idsCL[Yellow]}"
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then lmd="WARNING "
lclr="${idsCL[LightRed]}" elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
lmd="CRITICAL" lclr="${idsCL[LightRed]}"
lmd="CRITICAL"
else
lclr="${idsCL[Green]}"
lmd="Normal "
fi
c=0; spct=''; [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && spc1=`expr 6 - ${#temp_f}` || spc1=`expr 7 - ${#temp_f}`
until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done
reading="${lclr}${lmd}${spct}${temp_f_disp}${GAUGESH}"
else else
lclr="${idsCL[Green]}" temp_f=""
lmd="Normal " temp_f_disp=" "
lclr="${idsCL[Yellow]}"
lmd=""
reading="${idsCL[Yellow]}Sensor ${temp_f^} "
fi fi
c=0; spct=''; [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && spc1=`expr 6 - ${#temp_f}` || spc1=`expr 7 - ${#temp_f}`
until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done
reading="${lclr}${lmd}${spct}${temp_f_disp}${GAUGESH}"
else else
temp_f="" temp_f=""
temp_f_disp=" " temp_f_disp=" "
@@ -399,9 +407,11 @@ CHECKTEMPSENSOR(){
echo ${temp_f} echo ${temp_f}
elif [ ${TIMEOUT} -eq 1 ]; then elif [ ${TIMEOUT} -eq 1 ]; then
echo -en "${idsCL[Yellow]}Sensor Timeout${idsCL[Default]}" # echo -en "${idsCL[Yellow]}Sensor Timeout${idsCL[Default]}"
echo timeout
else else
echo -en "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}" # echo -en "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
echo offline
fi fi
} }
AVERAGETEMP(){ AVERAGETEMP(){