summary refs log tree commit diff stats
path: root/bin/vpn_toggle
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-06-01 16:10:10 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-06-01 16:10:10 +0200
commit8a3fab48c41d4d85f45f74b5a0806bf387cf515c (patch)
tree1de94c53e8b9f55499aaf9fe9b29803afd9b5be2 /bin/vpn_toggle
parentb5f27af0a9539eae22a3296f1a72a312125112f1 (diff)
downloaddotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.tar.gz
dotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.zip
add vpn
Diffstat (limited to 'bin/vpn_toggle')
-rwxr-xr-xbin/vpn_toggle23
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