Nov 11, '09 07:30:00AM • Contributed by: alexclst
I created a LaunchDaemon plist based on the composition of the iStat Server's LaunchDaemon plist to run the InternetSharing executable automatically at boot. Here's what it looks like:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>GroupName</key> <string>wheel</string> <key>UserName</key> <string>root</string> <key>KeepAlive</key> <true/> <key>Label</key> <string>InternetSharing</string> <key>OnDemand</key> <false/> <key>Program</key> <string>/usr/libexec/InternetSharing</string> <key>RunAtLoad</key> <true/> <key>StartOnMount</key> <false/> </dict> </plist>
To install it, just copy the plist file into /Library/LaunchDaemons. The next time you reboot, the Internet Sharing option should already be turned on (once you're fully logged into a user account). The end result is identical to the older hints, but uses the new LaunchDaemon implementation rather than editing system files or installing a StartupItem.
