Skip to content

Instantly share code, notes, and snippets.

@sirmax
Last active December 11, 2015 15:28
Show Gist options
  • Save sirmax/4620933 to your computer and use it in GitHub Desktop.
Save sirmax/4620933 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 2 && nEnabled;
do
echo 'resetting airport'
networksetup -setairportpower en1 off; networksetup -setairportpower en1 on
sleep 3.123
done
networksetup -getairportnetwork en1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment