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

19 lines
428 B
Plaintext
Raw Normal View History

2020-03-11 22:46:34 +00:00
#!/usr/bin/env sh
###
# Switch wireguard vpns up/down
###
STATUS="$(nmcli device status | grep -c wg0)"
case $STATUS in
1)
2020-03-12 00:36:30 +00:00
wg-quick down wg0
notify-send.py -a wireguard --replaces-process wireguard-status -i network-vpn-offline-symbolic Wireguard "Connection down" &
2020-03-11 22:46:34 +00:00
;;
*)
2020-03-12 00:36:30 +00:00
wg-quick up wg0
notify-send.py -a wireguard --replaces-process wireguard-status -i network-vpn-symbolic Wireguard "Connection up" &
2020-03-11 22:46:34 +00:00
;;
esac