diff options
author | sinanmohd <pcmsinan@gmail.com> | 2023-03-12 07:24:43 +0530 |
---|---|---|
committer | sinanmohd <pcmsinan@gmail.com> | 2023-03-12 07:25:11 +0530 |
commit | 815b86bc611d293647445580aad7b4bfda0fc129 (patch) | |
tree | 55368101be8cc39a14e1527c503803ef07f617f6 | |
parent | c1fed38d713b84d4260f0293610a82e36eb68907 (diff) |
vpn: make use of the grep --quiet flag instead of redirecting the output
-rwxr-xr-x | vpn | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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" |