diff options
Diffstat (limited to 'bin/vpn_toggle')
| -rwxr-xr-x | bin/vpn_toggle | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bin/vpn_toggle b/bin/vpn_toggle new file mode 100755 index 0000000..201b59e --- /dev/null +++ b/bin/vpn_toggle @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +out=$(sudo wg) + +if [ "$1" == "-i" ] +then + if [ -n "$out" ] + then + notify-send "vpn is activated" + else + notify-send "vpn is deactivated" + fi + exit +fi + +if [ -n "$out" ] +then + sudo wg-quick down /etc/wireguard/schwitz.conf + echo "vpn is deactivated" +else + sudo wg-quick up /etc/wireguard/schwitz.conf + echo "vpn is activated" +fi |