From 8a3fab48c41d4d85f45f74b5a0806bf387cf515c Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Sun, 1 Jun 2025 16:10:10 +0200 Subject: add vpn --- bin/vpn_toggle | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/vpn_toggle (limited to 'bin/vpn_toggle') 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 -- cgit 1.4.1