From 2d67d28c36009b0f96913d01cc59dd9137198077 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Fri, 12 May 2023 22:51:52 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index ef13486f..e382dcce 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -85,7 +85,7 @@ CHECKTEMP_SERVICE(){ fi elif [ $(bc -l <<< "$temp_f >= $temp_crit_sys") -eq 1 ]; then - echo "($datetime) SYSTEM CRITICAL: ${temp_f}°F - (Difference of ${temp_diff}°)" + echo "($datetime) SYSTEM CRITICAL: ${temp_f} F - (Difference of ${temp_diff}°)" >> ${logsrvc} if [ $temp_diff -gt 1 ] || [ "$last_temp" = "1" ]; then echo -e "($datetime) SYSTEM CRITICAL TEMP: ${temp_f}°F - (Difference of ${temp_diff}°)\nShutting down system servers!!" | mail -s "${1} TEMP CRITICAL" $email_alert echo "($datetime) alert sent" >> ${logsrvc} @@ -97,15 +97,15 @@ CHECKTEMP_SERVICE(){ else 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 -e "($datetime) Back to NORMAL TEMP: ${temp_f}°F - Previous Temp: ${last_temp}°F" >> ${logsrvc} + echo -e "($datetime) Back to NORMAL TEMP: ${temp_f} F - Previous Temp: ${last_temp} F" >> ${logsrvc} echo "($datetime) alert sent" >> ${logsrvc} elif [ $last_temp -eq 0 ]; then echo -e "($datetime) Service Startup\n NORMAL TEMP: ${temp_f}°F" | mail -s "${1} TEMP NORMAL" $email_alert; - echo -e "($datetime) Service Startup - NORMAL TEMP: ${temp_f}°F" >> ${logsrvc} + echo -e "($datetime) Service Startup - NORMAL TEMP: ${temp_f} F" >> ${logsrvc} fi last_temp=1 errtime=$(expr `date +%s` - $(stat -c %Y ${logsrvc})) - [ $errtime -ge 30 ] && echo "($datetime) Normal Temp: ${temp_f}°F" >> ${logacv} + [ $errtime -ge 10 ] && echo "($datetime) Normal Temp: ${temp_f} F" >> ${logsrvc} fi QRY="USE servermonitor; INSERT INTO sensor_data (\`sensorid\`, \`date\`, \`temp\`, \`hum\`) VALUES ('${SENSOR_ID[$1]}','${datetime}','${temp_f}','${temp_h}')"