From 055ea9467340b34bf14083fc604f48d73ab9f096 Mon Sep 17 00:00:00 2001 From: TheK4n Date: Mon, 23 May 2022 22:33:52 +0300 Subject: [PATCH] fix func wg-toggle --- sub/bash/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" }