Skip to content

Instantly share code, notes, and snippets.

View synox's full-sized avatar

Aravindo Wingeier synox

View GitHub Profile
tell application "System Events"
-- start playing with the VPN
tell current location of network preferences
-- set the name of the VPN service from your Network Settings
set VPNService to service "VPN myHome"
-- determine current VPN connection status
set isConnected to connected of current configuration of VPNService
if isConnected then
-- disconnect VPNService
else -- otherwise, connect to the VPN