mirror of
https://github.com/alrayyes/dotfiles/
synced 2023-11-14 15:56:30 +00:00
19 lines
420 B
Plaintext
19 lines
420 B
Plaintext
|
#!/usr/bin/env sh
|
||
|
|
||
|
###
|
||
|
# Switch wireguard vpns up/down
|
||
|
###
|
||
|
|
||
|
STATUS="$(nmcli device status | grep -c wg0)"
|
||
|
|
||
|
case $STATUS in
|
||
|
1)
|
||
|
sudo wg-quick down wg0
|
||
|
notify-send.py -a wireguard --replaces-process wireguard -i network-vpn-offline-symbolic Wireguard "Connection down"
|
||
|
;;
|
||
|
*)
|
||
|
sudo wg-quick up wg0
|
||
|
notify-send.py -a wireguard --replaces-process wireguard -i network-vpn-symbolic Wireguard "Connection up"
|
||
|
;;
|
||
|
esac
|