1
0
Fork 0
dotfiles/bin/mymenu-vpn

18 lines
315 B
Bash
Executable File

#!/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