aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <pcmsinan@gmail.com>2023-03-12 07:24:43 +0530
committersinanmohd <pcmsinan@gmail.com>2023-03-12 07:25:11 +0530
commit815b86bc611d293647445580aad7b4bfda0fc129 (patch)
tree55368101be8cc39a14e1527c503803ef07f617f6
parentc1fed38d713b84d4260f0293610a82e36eb68907 (diff)
vpn: make use of the grep --quiet flag instead of redirecting the output
-rwxr-xr-xvpn2
1 files changed, 1 insertions, 1 deletions
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"