Last active
December 10, 2015 14:18
-
-
Save brock/4446242 to your computer and use it in GitHub Desktop.
A function to start the OSX VPN from the command line. Just modify "My VPN Name" to the name you have in Network Preferences. Then from the command line run: vpn.
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
# place this with other bash functions in either ~/.bash_profile or a similar location | |
vpn () { | |
/usr/bin/env osascript <<EOF | |
tell application "System Events" | |
tell current location of network preferences | |
set VPN to service "My VPN Name" | |
if exists VPN then connect VPN | |
end tell | |
end tell | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment