Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kriista1234

macrumors 6502
Original poster
Jan 12, 2008
306
12
I recently setup VPN directly in OS X by using this guide:

https://www.publicvpn.com/support/MacOSX105.php

(A couple of friends have hired a dedicated server to run it through)

It's great that it's integrated right into the OS and it's just a menu bar click away. The problem is that whenever my computer goes to sleep it disconnects and I have to manually connect it again. I can set my computer to never go to sleep but that's a bit wasteful not to mention that closing/opening a laptop does the same thing.

Is there a way to make VPN be the default connect, always? So that when the computer goes to sleep and wakes back up, it connects the wifi and then immediately pulls up the VPN connection.
 

Skoopman

macrumors 6502
Sep 24, 2011
318
2
There is a way which I have not tried yet, because I don't have Xcode installed. Take a look here. If somebody makes the script into an application, please post it here.
 

kriista1234

macrumors 6502
Original poster
Jan 12, 2008
306
12
Just set it up. Not tested it yet (in the middle of doing other stuff) but hopefully it works.

Here's the script as an application(hardcoded to the VPN name being "VPN").
 

Attachments

  • VPN Auto Connect.zip
    51.7 KB · Views: 106

kriista1234

macrumors 6502
Original poster
Jan 12, 2008
306
12
Ok, it appears to work, though not immediately. It takes a bit before it autoconnects, but it does happen.

You do get the "disconnected from VPN" error every time you come out of sleep though, which is annoying.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.