1
0
Fork 0
dotfiles/bin/mymenu-vpn

18 lines
315 B
Plaintext
Raw Permalink Normal View History

2020-09-12 07:59:24 +00:00
#!/bin/bash
if [ "$(nmcli -g GENERAL.STATE con show $VPN_NAME || true)" == "activated" ]; then
choices=Disconnect
else
choices=Connect
fi
choice=$(echo -e $choices | wofi -i -d -W 400 -H 250 -p $VPN_NAME)
case $choice in
'Connect')
nmcli con up $VPN_NAME
;;
'Disconnect')
nmcli con down $VPN_NAME
esac