1
0
mirror of https://github.com/alrayyes/dotfiles/ synced 2023-11-14 15:56:30 +00:00

added vpn-switch

This commit is contained in:
Ryan Kes 2019-05-29 19:53:57 +02:00
parent a4c3d9c57e
commit 541dcd406c
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,20 @@
#!/bin/sh
###
# Switch wireguard vpns up/down
###
STATUS="$(nmcli device status | grep -c wg0)"
case $STATUS in
1)
sudo wg-quick down wg0 | notify-send
sudo wg-quick down wg1
;;
*)
sudo wg-quick up wg0
sudo wg-quick up wg1
;;
esac
notify-send 'adsf'

View File

@ -47,3 +47,7 @@
# dmenu application launcher
"dmenu-frequency"
Mod4 + p
# Wireguard
"~/.scripts/vpn-switch.sh"
Mod4 + w

View File

@ -10,9 +10,11 @@ case $STATUS in
1)
sudo wg-quick down wg0
sudo wg-quick down wg1
notify-send "down"
;;
*)
sudo wg-quick up wg0
sudo wg-quick up wg1
notify-send "up"
;;
esac