Update temp.inc.sh

This commit is contained in:
2024-01-31 20:05:52 -06:00
parent e7050331ab
commit 4c3a895f34

View File

@@ -645,7 +645,7 @@ CHECKTEMP_SERVICE_RUNSENSOR(){
##### ESXI FAN CONTROL #####
elif [[ "${PW_ESXI_FANSPEEDCONTROL_HOSTS}" = *"${PW_HOST_IDRACS[${SENSORa}]}"* ]] && [[ "${vSENSOR}" = *"Exhaust"* ]] && [ "${FanSpeed}" != "" ]; then
### GOLDILOCK ZONE ###
if (( $(bc <<< "${temp_f} >= ${GL_LOW}") )) && (( $(bc <<< "${temp_f} <= ${GL_HIGH}") )); then
if ((( $(bc <<< "${temp_f} >= ${GL_LOW}") )) && (( $(bc <<< "${temp_f} <= ${GL_HIGH}") ))) || [ ! -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set ]; then
if [ ! -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.gl ] && [ -f ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set ] && [ $(expr `date +%s` - $(stat -c %Y ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.set)) -ge 3600 ]; then
SENDNOTICE "${PW_HOST_IDRACS[${SENSORa}]} FAN CONTROL" "Goldilock Zone Found at ${FanSpeed}%"
echo "${FanSpeed}" >| ${PW_TMPFOLDER}/.lastfancheck/${SENSORa}.gl