From acd5b3b55ae527a8ef7634d2bf8b083c1763d400 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 8 Sep 2022 21:42:40 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index deea7eab..bb711cbc 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -62,29 +62,29 @@ CHECKTEMP_SERVICE(){ 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" == "1" ]; then - echo "($datetime) WARNING TEMP: $temp_f°F - (Difference of $temp_diff°)" | mail -s "${1} TEMP WARNING" $email_alert + 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 fi - echo "($datetime) WARNING: $temp_f°F - (Difference of $temp_diff°)" + 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" == "1" ]; then - echo "($datetime) CRITICAL TEMP: $temp_f°F - (Difference of $temp_diff°)" | mail -s "${1} TEMP CRITICAL" $email_alert + echo "($datetime) CRITICAL TEMP: ${temp_f}°F - (Difference of ${temp_diff}°)" | mail -s "${1} TEMP CRITICAL" $email_alert echo "alert sent" last_temp=$temp_f fi - echo "($datetime) CRITICAL: $temp_f°F - (Difference of $temp_diff°)" + echo "($datetime) CRITICAL: ${temp_f}°F - (Difference of ${temp_diff}°)" else if [ $last_temp -gt 1 ]; then - echo -e "($datetime) NORMAL TEMP: $temp_f°F\nPrevious Temp: $last_tempf°FF" | mail -s "${1} BACK TO NORMAL" $email_alert + echo -e "($datetime) NORMAL TEMP: ${temp_f}°F\nPrevious Temp: ${last_temp}°F" | mail -s "${1} BACK TO NORMAL" $email_alert echo "alert sent" elif [ "$last_temp" = "0" ]; then - echo "NORMAL TEMP: $temp_f°F" | mail -s "${1} TEMP NORMAL" $email_alert; + echo "NORMAL TEMP: ${temp_f}°F" | mail -s "${1} TEMP NORMAL" $email_alert; fi last_temp=1 - echo "($datetime) normal: $temp_f°F" + echo "($datetime) normal: ${temp_f}°F" fi QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${SENSOR_ID[$1]}','${datetime}','${temp_f}','${temp_h}')"