- Create a file called connectvpn.applescript using AppleScript Editor with the following:
tell application "System Events"
tell current location of network preferences
set VPNService to service "MYVPNNAME"
if exists VPNService then
Substitute "MYVPNNAME" with the name of your VPN service as it is shown in the settings app.
Save as application.
Add the saved .app to the boot items in the startup items in the users and group panel in the settings app. Don't forget to check the hide checkbox.