vendredi 6 mars 2015

Start/Stop Internet Sharing via Terminal in Yosemite w/out using AppleScript


Okay, I see this question has been asked a few times before (here, here, here and here), but none of those really answer the question for me.


I don't want to use the AppleScript suggestions provided to enable/disable Internet Sharing since future updates to the System Preferences GUI may break the AppleScript, as was the case in the linked posts above, and the solution seems a little clumsy, to be honest.


On Yosemite, sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist no longer works as there's no longer a .plist called InternetSharing.


I tried sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add Enabled -int 1 which I saw somewhere else, but that only toggles the actual checkbox in System Preferences and doesn't actually enable IS.


So ultimately, my question is this. What processes do I have to call from the command line to enable Internet Sharing, or conversely, what processes do I have to kill to disable Internet Sharing?





Aucun commentaire:

Enregistrer un commentaire