diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 2a8a11db..68c7abdd 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -565,42 +565,39 @@ CHECKTEMP(){ DIVIDER . white ${PRI_WIDTH} fi - if [ "${TTYPE}" == "fans" ]; then - if [[ "${PW_ESXI_FANSPEEDCONTROL_HOSTS}" = *"${PW_HOST_IDRACS[${SENSOR}]}"* ]]; then - if [ -f ${PW_TMPFOLDER}/.lastfancheck/${cSENSOR}.gl ]; then - FSC="${idsCL[LightGreen]}" - elif [ -f ${PW_TMPFOLDER}/.lastfancheck/${cSENSOR}.set ]; then - FSC="${idsCL[Green]}" - else - FSC="${idsCL[LightYellow]}" - fi - # echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F) ${idsCL[Default]}[ ${idsCL[Green]}${GL_LOW}°F${idsCL[Default]} <--> ${idsCL[LightYellow]}${GL_HIGH}°F${idsCL[Default]} ]" - echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F)" - echo -e " Last checked : ${idsCL[LightCyan]}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR} "+%m/%d @ %l:%M%p")${idsCL[Default]}" - echo -en " Last set : ${FSC}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set "+%m/%d @ %l:%M%p") " - if [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "uu" ]; then - echo -e "${idsCL[LightRed]}\u25B2 ${idsCL[Default]}" - elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "u" ]; then - echo -e "${idsCL[Magenta]}\u25B2 ${idsCL[Default]}" - elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "dd" ]; then - echo -e "${idsCL[LightGreen]}\u25BC ${idsCL[Default]}" - elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "d" ]; then - echo -e "${idsCL[LightCyan]}\u25BC ${idsCL[Default]}" - elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "m" ]; then - echo -e "${idsCL[LightCyan]}\u2720 ${idsCL[Default]}" - else - echo -e "${idsCL[Default]}" - fi - - # else - # echo -e " Fans are not managed for this host" - fi - fi fi ((t++)) done - if [ "${TTYPE}" == "fans" ] && [[ "${PW_ESXI_FANSPEEDCONTROL_HOSTS}" != *"${PW_HOST_IDRACS[${SENSOR}]}"* ]]; then - echo -e " Fans are not managed for this host" + if [ "${TTYPE}" == "fans" ]; then + if [[ "${PW_ESXI_FANSPEEDCONTROL_HOSTS}" = *"${PW_HOST_IDRACS[${SENSOR}]}"* ]]; then + if [ -f ${PW_TMPFOLDER}/.lastfancheck/${cSENSOR}.gl ]; then + FSC="${idsCL[LightGreen]}" + elif [ -f ${PW_TMPFOLDER}/.lastfancheck/${cSENSOR}.set ]; then + FSC="${idsCL[Green]}" + else + FSC="${idsCL[LightYellow]}" + fi + # echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F) ${idsCL[Default]}[ ${idsCL[Green]}${GL_LOW}°F${idsCL[Default]} <--> ${idsCL[LightYellow]}${GL_HIGH}°F${idsCL[Default]} ]" + echo -e " Goldilock Zone : ${idsCL[LightGreen]}${ESXI_DEFAULT_EXHAUST_MIN}°F (±${ESXI_FANSPEED_GL_ZONE}°F)" + echo -e " Last checked : ${idsCL[LightCyan]}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR} "+%m/%d @ %l:%M%p")${idsCL[Default]}" + echo -en " Last set : ${FSC}$(date -r ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set "+%m/%d @ %l:%M%p") " + if [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "uu" ]; then + echo -e "${idsCL[LightRed]}\u25B2 ${idsCL[Default]}" + elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "u" ]; then + echo -e "${idsCL[Magenta]}\u25B2 ${idsCL[Default]}" + elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "dd" ]; then + echo -e "${idsCL[LightGreen]}\u25BC ${idsCL[Default]}" + elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "d" ]; then + echo -e "${idsCL[LightCyan]}\u25BC ${idsCL[Default]}" + elif [ "$(cat ${PW_TMPFOLDER}/.lastfancheck/${SENSOR}.set | cut -d'~' -f 2)" == "m" ]; then + echo -e "${idsCL[LightCyan]}\u2720 ${idsCL[Default]}" + else + echo -e "${idsCL[Default]}" + fi + + else + echo -e " Fans are not managed for this host" + fi fi else echo -e "${idsCL[LightCyan]} ${vHOSTNAME}${spc}${idsCL[Default]}: No Data"