I have created a startup/shutdown/restart script which will disable the wi-fi on shutdown/restart and re-enable the
wi-fi on startup. This has fixed the issue on my 2008 MB where the wi-fi would not turn on after installing Mountain Lion. The script must be owned by root with permissions set to 755. Do the following in terminal.
1. sudo passwd root (enable root password)
2. su root
3. cd /Library/StartupItems
4. create the following 4 files/directories:
Wi-Fi_Fix/Resources/English.lproj/Localizable.strings
Wi-Fi_Fix/Resources/version.plist
Wi-Fi_Fix/StartupParameters.plist
Wi-Fi_Fix/Wi-Fi_Fix
Here's the file contents:
Wi-Fi_Fix/Resources/English.lproj/Localizable.strings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>Starting Wi-Fi_Fix</key>
<string>Starting Wi-Fi_Fix</string>
<key>Stopping Wi-Fi_Fix</key>
<string>Stopping Wi-Fi_Fix</string>
<key>Restarting Wi-Fi_Fix</key>
<string>Restarting Wi-Fi_Fix</string>
</dict>
</plist>
Wi-Fi_Fix/Resources/version.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildVersion</key>
<string>0</string>
<key>CFBundleShortVersionString</key>
<string>2.5.2</string>
<key>CFBundleVersion</key>
<string>2.5.2</string>
<key>ProjectName</key>
<string>Wi-Fi_Fix StartupItem</string>
<key>SourceVersion</key>
<string>675</string>
</dict>
</plist>
Wi-Fi_Fix/StartupParameters.plist:
{
Description = "Wi-Fi_Fix";
OrderPreference = "Early";
Provides = ("Wi-Fi_Fix");
Messages =
{
start = "Starting Wi-Fi_Fix";
stop = "Stopping Wi-Fi_Fix";
};
}
Wi-Fi_Fix/Wi-Fi_Fix:
#!/bin/sh
#
# Bug fix for Wi-Fi not connecting
#
. /etc/rc.common
StartService ()
{
networksetup -setnetworkserviceenabled Wi-Fi on
}
StopService ()
{
networksetup -setnetworkserviceenabled Wi-Fi off
}
RestartService ()
{
StopService
StartService
}
#
# main script
#
# must make sure we are on a system with the RunService() function
# implemented (not implemented on Mac OS 10.1.x)
foundRunService=`grep -c RunService /etc/rc.common`
if [ $foundRunService -a $foundRunService -eq 1 ]; then
RunService "$1"
else
case $1 in
"start") StartService;;
"stop") StopService;;
"restart") RestartService;;
*) echo "$0: unknown option: $1" > /tmp/wi-fi_fix.out ;;
esac
fi
5. cd /Library/StartupItems
6. chmod -R 755 Wi-Fi_Fix
7. exit and close terminal
8. reboot computer 2 times.
The Wi-Fi_Fix needs 2 reboots to take effect. On the first shut-down of the reboot, the program hasn't been loaded, so it won't disable the wifi. After first reboot, it will appear as if the problem still exists, but the program is now loaded, and wi-fi will be shut-down and enabled correctly upon the second reboot.