Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@evantahler
Created August 9, 2019 21:12
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 evantahler/e5b2ad349d022f7d1165d9417a737603 to your computer and use it in GitHub Desktop.
Save evantahler/e5b2ad349d022f7d1165d9417a737603 to your computer and use it in GitHub Desktop.
Keep that VPN Connected (OSX)
on idle
tell application "System Events"
tell current location of network preferences
set VPNService to the service "vpn-evan" -- replace this with the name of your VPN connection
if VPNService is not null then
if current configuration of VPNService is not connected then
beep
beep
beep
connect VPNService
end if
end if
end tell
end tell
-- in "idle" blocks, the number returned is how long to sleep until running again
return 60
end idle
@evantahler
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment