Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Created October 22, 2014 19:41
Show Gist options
  • Select an option

  • Save tjluoma/6a80ce00edb2989228d7 to your computer and use it in GitHub Desktop.

Select an option

Save tjluoma/6a80ce00edb2989228d7 to your computer and use it in GitHub Desktop.
Change "VPN-Unlimited-US-Сenter" to whatever the name of your VPN connection is
tell application "System Events"
tell network preferences
set VPNservice to service "VPN-Unlimited-US-Сenter"
set isConnected to connected of current configuration of VPNservice
if not isConnected then
connect VPNservice
end if
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment