summary refs log tree commit diff stats
path: root/bin
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
parentb5f27af0a9539eae22a3296f1a72a312125112f1 (diff)
downloaddotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.tar.gz
dotfiles-8a3fab48c41d4d85f45f74b5a0806bf387cf515c.zip
add vpn
Diffstat (limited to 'bin')
-rwxr-xr-xbin/port-forwarding3
-rwxr-xr-xbin/vpn_toggle23
2 files changed, 26 insertions, 0 deletions
diff --git a/bin/port-forwarding b/bin/port-forwarding
new file mode 100755
index 0000000..c904110
--- /dev/null
+++ b/bin/port-forwarding
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+while true ; do date ; natpmpc -a 1 0 udp 60 -g 10.2.0.1 && natpmpc -a 1 0 tcp 60 -g 10.2.0.1 || { echo -e "ERROR with natpmpc command \a" ; break ; } ; sleep 45 ; done
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