Update powerwall.sh

This commit is contained in:
2022-09-08 21:46:48 -05:00
parent 6adfa172a7
commit 2a705d90ea

View File

@@ -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" = "1" ]; then
if [ $temp_diff -gt 1 ] || [ $last_temp -eq 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" = "1" ]; then
if [ $temp_diff -gt 1 ] || [ $last_temp -eq 1 ]; then
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
@@ -80,7 +80,7 @@ CHECKTEMP_SERVICE(){
if [ $last_temp -gt 1 ]; then
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
elif [ $last_temp -eq 0 ]; then
echo "NORMAL TEMP: ${temp_f}°F" | mail -s "${1} TEMP NORMAL" $email_alert;
fi
last_temp=1