Last active
November 5, 2021 17:36
-
-
Save vanenshi/a8d454e2612b2599707c962067abd3a9 to your computer and use it in GitHub Desktop.
toggle VPN connection bash script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VPN_NAME="<Your-VPN-Connection-NAME>" | |
if nmcli connection show --active | grep "$VPN_NAME" | |
then | |
nmcli connection down id "$VPN_NAME" | |
else | |
nmcli connection up id "$VPN_NAME" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment