diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index a93010f4..020f2073 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -109,7 +109,6 @@ CHECKTEMP(){ if [ ! -f ${PW_TMPFOLDER}/${SENSOR}.down ]; then echo -en "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Pulling data ... " temp_f=$(CHECKTEMPSENSOR ${SENSOR}) - echo "HERE: '${temp_f}'" c=0; spct=''; [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]] && spc1=`expr 5 - ${#temp_f}` || spc1=`expr 6 - ${#temp_f}` until [ ${c} = ${spc1} ]; do spct="${spct} "; c=`expr ${c} + 1`; done @@ -162,7 +161,18 @@ CHECKTEMP(){ else if [ "${avgdays}" != "noavg" ]; then average=$(AVERAGETEMP ${SENSOR} ${avgdays}) - echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${reading}${idsCL[Default]}" + ([ "${PW_SENSOR_TYPE[${SENSOR}]}" == "system" ] && [[ "${SENSOR}" = *"FAN"* ]]) && average_disp=$(IDS_NUMBER_FORMAT ${average}) || average_disp=${average} + c=0; spca=''; spc1=`expr 6 - ${#average_disp}`; until [ ${c} = ${spc1} ]; do spca="${spca} "; c=`expr ${c} + 1`; done + if [ "${average_disp}" == "" ]; 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_disp}" + else + averagedisp="${idsCL[Green]}${average_disp}" + fi + echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline /${spca}${averagedisp}${GAUGESH}${idsCL[Default]}" else echo -e "\r\033[K${idsCL[White]}${idsST[Bold]}${SENSOR}${idsST[Reset]}${spc}${idsCL[Default]}: ${idsCL[Yellow]}Sensor Offline${idsCL[Default]}" fi