Created
August 4, 2017 12:29
-
-
Save eriknelson/6da124afec23d20de35585e96bbd448e to your computer and use it in GitHub Desktop.
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/bash | |
CONNAME="Raleigh (RDU2)" | |
CONID=$(nmcli con | grep Raleigh | awk '{print $3}') | |
ACTION=$1 | |
if [[ "$ACTION" != "up" ]] && [[ "$ACTION" != "down" ]]; then | |
echo "ERROR: First argument must be 'up' or 'down'" | |
exit 1 | |
elif [[ "$ACTION" == "up" ]]; then | |
echo "Connecting to RH VPN..." | |
nmcli con up --ask $CONID | |
elif [[ "$ACTION" == "down" ]]; then | |
echo "Disconnecting from RH VPN..." | |
nmcli con down $CONID | |
fi | |
nmcli con |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment