From c82fc9f5af0cd2415fac3c4813fb86c6bfc5d5d5 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Mon, 11 Dec 2023 18:15:35 -0600 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 4c9a56fc..799210aa 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -245,8 +245,6 @@ CHECKTEMP_SERVICE(){ fi if [ "${SENSORS_CHECK}" != "" ]; then for SENSOR in "${SENSORS_CHECK[@]}"; do - [ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0 - echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}" if [ "${PW_THRESHOLDS[${SENSORa}]}" != "" ]; then echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 1 | read temp_warn echo ${PW_THRESHOLDS[${SENSORa}]} | cut -d',' -f 2 | read temp_crit @@ -292,7 +290,8 @@ CHECKTEMP_SERVICE(){ temp_h='' fi - echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}" + [ "${last_temp[${SENSOR//-/}]}" == "" ] && last_temp[${SENSOR//-/}]=0 + logtemp=${PW_LOGFOLDER}/log-temp-${SENSOR} if [ "${temp_c}" != "null" ] && [ "${temp_c}" != "" ]; then [ "${PW_SENSOR_TYPE[${SENSORa}]}" == "cpu" ] && GAUGE="CPU-USAGE" || GAUGE="TEMP" @@ -303,7 +302,6 @@ CHECKTEMP_SERVICE(){ rm -f ${PW_TMPFOLDER}/${SENSOR}-error.reading fi - echo "${SENSOR//-/} - ${last_temp[${SENSOR//-/}]}" [ "${PW_SENSOR_TYPE[${SENSOR}]}" == "cpu" ] && temp_f=$(echo "scale=2; $temp_c/1" | bc -l) || temp_f=$(echo "scale=2; ${temp_c}*1.8 + 32" | bc) [ "${SENSOR}" == "ServerRoomTH" ] && temp_f=`echo "scale=2; ${temp_f}+${PW_ServerRoomTH_Dev}" | bc` @@ -316,9 +314,7 @@ CHECKTEMP_SERVICE(){ echo ${PW_THRESHOLDS[${SENSOR}]} | cut -d',' -f 3 | read temp_crit_sys fi - echo 1 if (( $(bc <<< "${temp_f} < ${temp_warn}") )); then - echo "2 - ${last_temp[${SENSOR//-/}]}" if (( $(bc <<< "${last_temp[${SENSOR//-/}]} > 1") )); then SENDNOTICE "${SENSOR} BACK TO NORMAL" "NORMAL TEMP: ${temp_f}${GAUGESH} Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}" @@ -327,7 +323,6 @@ Previous Temp: ${last_temp[${SENSOR//-/}]}${GAUGESH}" # [ "$(compgen -G "${PW_TMPFOLDER}/power.*.off")" != "" ] && rm -f ${PW_TMPFOLDER}/power.*.off elif [ "${last_temp[${SENSOR//-/}]}" == "0" ]; then - echo 4 # SENDNOTICE "${SENSOR} TEMP NORMAL" "Service Startup # NORMAL TEMP: ${temp_f}${GAUGESH}" echo -e "($(date +'%Y-%m-%d %H:%M:%S')) - ${temp_f}${GAUGESH} - Service Startup - NORMAL ${GAUGE}" >> ${logtemp}