ControlPlane: Unable to Enable/Disable Internet Sharing in 10.11 El Capitan

It seams El Capitan doesn’t use com.apple.InternetSharing.plist for Internet Sharing anymore. I recently upgraded from Mavericks to El Capitan and my ControlPlane setup for toggling Internet Sharing on MacBook Pro on lid open/close, no longer works.

This is what I see in system.log:

com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.system): Could not read path: path = /System/Library/LaunchDaemons/com.apple.InternetSharing.plist, error = 2: No such file or directory

About this issue

  • Original URL
  • State: open
  • Created 9 years ago
  • Comments: 22 (8 by maintainers)

Most upvoted comments

This works to turn it on/off:

tell application "System Preferences"
    activate
    reveal (pane id "com.apple.preferences.sharing")
end tell

tell application "System Events" to tell process "System Preferences"
    delay 2
    repeat with r in rows of table 1 of scroll area 1 of group 1 of window "Sharing"
        if (value of static text of r as text) starts with "Internet" then
            set sharingBool to value of checkbox of r as boolean
            select r
            if sharingBool is false then click checkbox of r
            #if sharingBool is true then click checkbox of r
        end if
    end repeat
    delay 2

    if (exists sheet 1 of window "Sharing") then
        click button "Start" of sheet 1 of window "Sharing"
    end if

end tell