mirror of
https://github.com/alrayyes/dotfiles/
synced 2023-11-14 15:56:30 +00:00
added vpn-switch
This commit is contained in:
parent
a4c3d9c57e
commit
541dcd406c
20
bin/.scripts/vpn-switch.sh
Normal file
20
bin/.scripts/vpn-switch.sh
Normal 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'
|
@ -47,3 +47,7 @@
|
||||
# dmenu application launcher
|
||||
"dmenu-frequency"
|
||||
Mod4 + p
|
||||
|
||||
# Wireguard
|
||||
"~/.scripts/vpn-switch.sh"
|
||||
Mod4 + w
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user