Created
November 11, 2018 14:17
-
-
Save neuthral/d176e0c8906f8d515417113964fcc512 to your computer and use it in GitHub Desktop.
vpn autoconnect #cli #network
This file contains 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/bash | |
REQUIRED_CONNECTION_NAME="Wired connection 1" | |
VPN_CONNECTION_NAME="bender" | |
activ_con=$(nmcli con status | grep "${REQUIRED_CONNECTION_NAME}") | |
activ_vpn=$(nmcli con status | grep "${VPN_CONNECTION_NAME}") | |
if [ "${activ_con}" -a ! "${activ_vpn}" ]; | |
then | |
nmcli con up id "${VPN_CONNECTION_NAME}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment