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(){