From a8b95951dee4fbd47ee8ec2fe24b135e5acd41d4 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 8 Sep 2022 21:30:28 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 7e63e739..85b32e4b 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -77,12 +77,13 @@ CHECKTEMP_SERVICE(){ echo "($datetime) CRITICAL: $temp_f°F - (Difference of $temp_diff°)" else - if [ "$last_temp" != "1" ]; then + if [ "$last_temp" > "1" ]; then echo "($datetime) NORMAL TEMP: $temp_f°F" | mail -s "${1} BACK TO NORMAL" $email_alert echo "alert sent" - last_temp=1 + elif [ "$last_temp" == "0" ]; then + echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert; fi - [ "$last_temp" == "0" ] && echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert; last_temp=1 + last_temp=1 echo "($datetime) normal: $temp_f°F" fi