1
0
Fork 0
dotfiles/bin/vpn-toggle

13 lines
245 B
Plaintext
Raw Normal View History

2020-09-12 07:59:24 +00:00
#!/bin/bash
# export VPN_NAME=MyVPN from dotfiles/secrets/vpn
if [ "$(nmcli -g GENERAL.STATE con show $VPN_NAME)" == "activated" ]; then
echo Disconnecting
nmcli con down "$VPN_NAME"
else
echo Connecting
nmcli con up "$VPN_NAME"
fi
exit 0