From 791d9075cded629be031343468619abb11d890d5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 28 Oct 2024 22:12:50 -0500 Subject: [PATCH] Update temp.inc.sh --- inc/temp.inc.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/inc/temp.inc.sh b/inc/temp.inc.sh index 7721ea64..74bdc799 100644 --- a/inc/temp.inc.sh +++ b/inc/temp.inc.sh @@ -15,13 +15,17 @@ GET_HOST_FANSPEED(){ START_POWERWALL_FAN(){ pwmconfig & sleep 4s - killall pwmconfig - temp_c=$(cat ${PW_FANINPUT}) - if [ ${temp_c} -gt 0 ]; then - fs=$(IDS_NUMBER_FORMAT ${temp_c}) - SENDNOTICE "Starting up the ${SENSOR}" "Startup confirmed, the fan is now reading: ${fs}'RPM" + killall pwmconfig >/dev/null 2>&1 + if [ -f ${PW_FANINPUT} ]; then + temp_c=$(cat ${PW_FANINPUT}) + if [ ${temp_c} -gt 0 ]; then + fs=$(IDS_NUMBER_FORMAT ${temp_c}) + SENDNOTICE "Starting up the ${SENSOR}" "Startup confirmed, the fan is now reading: ${fs}'RPM" + else + SENDNOTICE "FAILED to start ${SENSOR}" "Cannot start the fan, ERROR WILL ROBINSON!!!" 1 + fi else - SENDNOTICE "FAILED to start ${SENSOR}" "Cannot start the fan, ERROR WILL ROBINSON!!!" + SENDNOTICE "FAILED to start ${SENSOR}" "Cannot find hardware (${PW_FANINPUT}), ERROR ERROR ERROR... DOES NOT COMPUTE... YOU SUCK" 1 fi } CHECKTEMP(){