Update powerwall.sh

This commit is contained in:
2022-09-03 14:26:48 -05:00
parent 6d66c83c92
commit c751f4a431

View File

@@ -52,9 +52,9 @@ CHECKTEMP_SERVICE(){
echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 1 | read temp_warn
echo ${TEMP_THRESHOLDS[${1}]} | cut -d',' -f 2 | read temp_crit
temp_diff=$(($last_temp - $temp_f))
temp_diff=$((${last_temp%.*} - ${temp_f%.*}))
[ $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
[ $temp_diff -gt 1 ] && echo "($temp_diff) WARNING TEMP: $temp_f°F" | mail -s "${1} TEMP WARNING" $email_alert
echo "($temp_d @ $temp_t) WARNING: $temp_f°F"