diff --git a/sub/bash/functions b/sub/bash/functions index 6d5c391..b58cb7e 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -162,6 +162,6 @@ wg-toggle() { SERVICE="wg-quick@$CONFIG.service" STATUS=$(systemctl status "$SERVICE" | grep Active | awk -F ": " '{printf $2}' | awk -F " " '{printf $1}') - test "$STATUS" = "inactive" && sudo systemctl start "$SERVICE" || sudo systemctl stop "$SERVICE" + test "$STATUS" != "active" && sudo systemctl start "$SERVICE" || sudo systemctl stop "$SERVICE" }