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