From 2b4986516b0ff9ce397db0dbb811740203b7af78 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Sun, 11 Sep 2022 15:37:23 -0500 Subject: [PATCH] Update powerwall.sh --- powerwall.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/powerwall.sh b/powerwall.sh index 3f78458b..10ffeffc 100755 --- a/powerwall.sh +++ b/powerwall.sh @@ -123,10 +123,12 @@ CHECKACV_SERVICE(){ [ $VERBOSE = true ] && echo "($datetime) back to normal voltage: ${INPUTACV}V" echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "POWER NOMINAL AGAIN" $email_alert [ $VERBOSE = true ] && echo "alert sent" - elif [ $voltstatus -eq 0 ]; then + else [ $VERBOSE = true ] && echo "($datetime) normal voltage: ${INPUTACV}V" - echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "Power Nominal" $email_alert - [ $VERBOSE = true ] && echo "alert sent" + if [ $voltstatus -eq 0 ]; then + echo -e "($datetime) Normal voltage detected\nVOLTAGE: ${INPUTACV}V" | mail -s "Power Nominal" $email_alert + [ $VERBOSE = true ] && echo "alert sent" + fi fi voltstatus=1 else