From 1172da224540f69ab5728cb78fd678d20e11924e Mon Sep 17 00:00:00 2001 From: TheK4n Date: Mon, 23 May 2022 22:37:45 +0300 Subject: [PATCH] ref: func vpn --- sub/bash/functions | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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" }