Skip to content

Instantly share code, notes, and snippets.

@Dreyer
Created January 5, 2017 19:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dreyer/50fc7eb67d73288ca8279da3216be483 to your computer and use it in GitHub Desktop.
Save Dreyer/50fc7eb67d73288ca8279da3216be483 to your computer and use it in GitHub Desktop.
Automatically reconnect when disconnected from the VPN.
on idle
tell application "System Events"
tell current location of network preferences
set myConnection to the service "WorkVPN"
if myConnection is not null then
if current configuration of myConnection is not connected then
connect myConnection
end if
end if
end tell
return 120
end tell
end idle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment