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 ... "
if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then
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 [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
lclr="${idsCL[Yellow]}"
lmd="WARNING "
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
lclr="${idsCL[LightRed]}"
lmd="CRITICAL"
if [ "${temp_f}" != "timeout" ] && [ "${temp_f}" != "offline" ]; then
[ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && temp_f_disp=$(IDS_NUMBER_FORMAT ${temp_f} 0) || temp_f_disp=${temp_f}
if [ $(bc -l <<< "${temp_f} >= ${temp_warn}") -eq 1 ] && [ $(bc -l <<< "${temp_f} < ${temp_crit}") -eq 1 ]; then
lclr="${idsCL[Yellow]}"
lmd="WARNING "
elif [ $(bc -l <<< "${temp_f} >= ${temp_crit}") -eq 1 ]; then
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
lclr="${idsCL[Green]}"
lmd="Normal "
temp_f=""
temp_f_disp=" "
lclr="${idsCL[Yellow]}"
lmd=""
reading="${idsCL[Yellow]}Sensor ${temp_f^} "
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
temp_f=""
temp_f_disp=" "
@@ -399,9 +407,11 @@ CHECKTEMPSENSOR(){
echo ${temp_f}
elif [ ${TIMEOUT} -eq 1 ]; then
echo -en "${idsCL[Yellow]}Sensor Timeout${idsCL[Default]}"
# echo -en "${idsCL[Yellow]}Sensor Timeout${idsCL[Default]}"
echo timeout
else
echo -en "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
# echo -en "${idsCL[Yellow]}Sensor Offline${idsCL[Default]}"
echo offline
fi
}
AVERAGETEMP(){