2

There must be a way to control the built-in VPN client in OS-X Snow Leopard, I simply can't find documentation about it. I want to be able to connect and disconnect while I'm ssh'd into my box remotely. Does anyone know how to do that?

1

save the following AppleScript to gfw.scpt

tell application "System Events"
    tell current location of network preferences
        set VPNservice to service "The Great Fire Wall" -- name of the VPN service
        if exists VPNservice then connect VPNservice
        set isConnected to connected of current configuration of VPNservice
        if isConnected then
            --- do something or nothing
        end if
    end tell
end tell

use osascript gfw.scpt to start it from terminal.

3
  • Gotta love AppleScript... so verbose. :( – Michael Caron May 7 '10 at 13:22
  • I'm using this in Terminal.app which works ok. Does it work for you via ssh? – freewizard May 19 '10 at 5:37
  • No: startIntelix.scpt:50:58: script error: Expected end of line but found identifier. (-2741) – Michael Caron May 24 '10 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.