From 815b86bc611d293647445580aad7b4bfda0fc129 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sun, 12 Mar 2023 07:24:43 +0530 Subject: vpn: make use of the grep --quiet flag instead of redirecting the output --- vpn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpn b/vpn index 0e5998e..6d5d7fe 100755 --- a/vpn +++ b/vpn @@ -12,7 +12,7 @@ main() { wg_conf="${1:-wg0}" - if ip -details link show "$wg_conf" 2> /dev/null | grep "wireguard" > /dev/null 2>&1 + if ip -details link show "$wg_conf" 2> /dev/null | grep --quiet "wireguard" then sudo -A -p "撚 halt vpn: " wg-quick down "$wg_conf" && note "connection was dropped" -- cgit v1.2.3