From 7aefee2547df3998298fe6a8eaf2b2b4ca4af9e3 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sat, 10 Sep 2022 10:42:22 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index cc861d8c..cdfd4d1d 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -61,7 +61,7 @@ CHECKTEMP_SERVICE(){ [ $temp_diff -lt 0 ] && temp_diff=$(($temp_diff * -1)) if [ $(bc -l <<< "$temp_f >= $temp_warn") -eq 1 ] && [ $(bc -l <<< "$temp_f < $temp_crit") -eq 1 ]; then - if [ $temp_diff -gt 1 ] || [ $last_temp -eq 1 ]; then + if [ $temp_diff -gt 1 ] || [ "$last_temp" = "1" ]; then echo "($datetime) WARNING TEMP: ${temp_f}°F - (Difference of ${temp_diff}°)" | mail -s "${1} TEMP WARNING" $email_alert echo "alert sent" last_temp=$temp_f @@ -69,7 +69,7 @@ CHECKTEMP_SERVICE(){ echo "($datetime) WARNING: ${temp_f}°F - (Difference of ${temp_diff}°)" elif [ $(bc -l <<< "$temp_f >= $temp_crit") -eq 1 ]; then - if [ $temp_diff -gt 1 ] || [ $last_temp -eq 1 ]; then + if [ $temp_diff -gt 1 ] || [ "$last_temp" = "1" ]; then echo -e "($datetime) CRITICAL TEMP: ${temp_f}°F - (Difference of ${temp_diff}°)\nShutting down servers!!" | mail -s "${1} TEMP CRITICAL" $email_alert echo "alert sent" last_temp=$temp_f