MacOS – Wi-Fi turning on and off since Mavericks upgrade

macoswifi

MacBook Pro
Retina, 15-inch, Early 2013

Since upgrading to Mavericks, the Wi-Fi turns off for roughly 8 seconds and turn back on for roughly 8 seconds. I have tried this on several different networks in different physical locations. It seems to be the exact same symptoms as described in this Apple Support Communities thread – even turning Wi-Fi off manually doesn't help (it just turns right back on again).

I tried this and rebooting, but it didn't work

Try backing up and then deleting this file:
com.apple.airport.preferences.plist

from this folder:
/Library/Preferences/SystemConfiguration/

In fact, none of the suggestions in the thread seemed to work.

I would rather not go through the trouble of downgrading since Ethernet works.

Best Answer

Turns out there was a custom script running under a subdirectory of /Library/Scripts/ on this laptop. It looked something like this:

#!/bin/bash

dscacheutil -flushcache
if ifconfig en0 | grep inet;
then 
    /usr/sbin/networksetup -setairportpower en1 off
    /usr/sbin/networksetup -setairportpower en2 off
else
    /usr/sbin/networksetup -setairportpower en1 on
    /usr/sbin/networksetup -setairportpower en2 on
fi

Commenting its insides out fixed the problem The Wi-Fi no long periodically disconnects. I'm guessing that between 10.8 and 10.9, one of the commands in that script changed.