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