Skip to content

Instantly share code, notes, and snippets.

@falsefalse
Created May 13, 2015 20:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save falsefalse/9622cc87716082867e53 to your computer and use it in GitHub Desktop.
Save falsefalse/9622cc87716082867e53 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
function nEnabled {
system_profiler -detailLevel mini SPAirPortDataType | grep -e 'Supported PHY Modes: .*n'
}
until nEnabled && sleep 5 && nEnabled;
do
echo 'resetting airport'
networksetup -setairportpower en1 off; networksetup -setairportpower en1 on
sleep 2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment