aboutsummaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorsinanmohd <pcmsinan@gmail.com>2022-12-05 18:30:35 +0530
committersinanmohd <pcmsinan@gmail.com>2023-03-11 19:05:02 +0530
commit6e99499c1f13008581f9070206b71c0a51cdb28e (patch)
tree9b1be1ac30912793b1d233059f6f4ef9d1a5d1ef /vpn
initial commit
Diffstat (limited to 'vpn')
-rwxr-xr-xvpn27
1 files changed, 27 insertions, 0 deletions
diff --git a/vpn b/vpn
new file mode 100755
index 0000000..061d1f8
--- /dev/null
+++ b/vpn
@@ -0,0 +1,27 @@
+#!/bin/sh
+# https://sinanmohd.com
+
+####################
+## user variables ##
+####################
+# wireguard config name, located at /etc/wireguard/
+conf_name="kay"
+# state file location
+state_file="/tmp/vpn.dmenu"
+
+
+if [ ! -e "$state_file" ]
+then
+ if sudo -A -p "撚 initialize vpn: " wg-quick up "$conf_name"
+ then
+ touch "$state_file" &&
+ notify-send "撚 VPN initialized" "Traffic is routing through external server" &&
+ wip
+ fi
+else
+ sudo -A -p "撚 halt vpn: " wg-quick down "$conf_name" &&
+ rm "$state_file" &&
+ notify-send "撚 VPN Halted" "Connection was dropped" &&
+ sleep 3 &&
+ wip
+fi