I now this may sound quite lazy, but I connect to a VPN several times a day (since the laptop gets disconnected from time to time).
I am aware of the "Show VPN Status in the Menubar" option, but is there a way I can make it a keyboard shortcut?
I now this may sound quite lazy, but I connect to a VPN several times a day (since the laptop gets disconnected from time to time).
I am aware of the "Show VPN Status in the Menubar" option, but is there a way I can make it a keyboard shortcut?
You could create an AppleScript which would run a shell script to racoonctl - the specific commands will depend upon your VPN connection. Then use Script Utility to enable the global Script Menu, then add a new keyboard shortcut in System Preferences > Keyboard > Keyboard Shortcuts, and assign it to the script (or use a launcher utility such as Quicksilver).
Add the "Run AppleScript" action to the workflow, and replace its script contents with the following:
tell application "System Events"
tell current location of network preferences
set VPN to "SERVICE NAME"
set VPNactive to connected of current configuration of service VPN
if VPNactive then
disconnect service VPN
else
connect service VPN
end if
end tell
end tell
Be sure to replace SERVICE NAME with the name of your VPN connection, which can be looked up in the Network system preferences (if the name is truncated, click the Advanced... button and view the full name at the top of the Advanced Settings panel).
Save the workflow with a name like "Connect to VPN"
I personally assign `Control + Option + Command + V' to toggle my VPN.
From cnet.