• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Was gibt es Schöneres als den Mai draußen in der Natur mit allen Sinnen zu genießen? Lasst uns teilhaben an Euren Erlebnissen und macht mit beim Thema des Monats Da blüht uns was! ---> Klick

VPN Automatischer Connect

kevin@mac

Boskop
Registriert
09.02.08
Beiträge
212
Hallo zusammen, habe folgendes AppleScript hier imForum gefunden, um automatisch eine VPN (PPTP) Verbindung aufzubauen:
Code:
 set NetName to do shell script ("system_profiler SPAirPortDataType |grep -e " & quoted form of "Current Wireless Network:" & " |awk '{print $4,$5,$6,$7}'") as string

if NetName contains "AnasHome" then
    -- at home, no pptp connection
else if NetName contains "Uni-Bremen" then
    -- on campus, start pptp-connection
    tell application "Internet Connect"
        activate
        connect configuration "VPN (PPTP)"
        quit
    end tell
else
    -- somewhere else, do nothing
end if
Leider kommt im Skripteditor beim Abspeichern immer die Fehlermeldung "Zeilenende erwartet, Identifer "configuration" gefunden."

ich habe absolut keine Ahnung von AppleScript und wäre sehr für eure Hilfe dankbar. Nutze Leopard. :)

EDIT:
Folgendes Skript geht:
Code:
tell application "System Events"
    tell current location of network preferences
        set VPNservice to service "VPN (L2TP) 2" -- name of the VPN service
        if exists VPNservice then connect VPNservice
    end tell
end tell

Problem damit gelöst...