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

19 lines
362 B
Plaintext
Raw Normal View History

2020-02-22 19:40:41 +00:00
#!/usr/bin/env sh
2019-05-29 17:53:57 +00:00
###
# Switch wireguard vpns up/down
###
STATUS="$(nmcli device status | grep -c wg0)"
case $STATUS in
2020-02-22 19:40:41 +00:00
1)
sudo wg-quick down wg0
2020-03-05 20:29:17 +00:00
notify-send.py -a wireguard -i network-vpn-offline-symbolic Wireguard "Connection down"
2020-02-22 19:40:41 +00:00
;;
*)
sudo wg-quick up wg0
2020-03-05 20:29:17 +00:00
notify-send.py -a wireguard -i network-vpn-symbolic Wireguard "Connection up"
2020-02-22 19:40:41 +00:00
;;
esac