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