Skip to content

Instantly share code, notes, and snippets.

@DarwinAwardWinner
Created November 17, 2014 21:56
Show Gist options
  • Save DarwinAwardWinner/d2f2b97540e8c3ff733d to your computer and use it in GitHub Desktop.
Save DarwinAwardWinner/d2f2b97540e8c3ff733d to your computer and use it in GitHub Desktop.
Script for turning wifi off and on again
--
-- Toggle Airport Power Off and On again
--
if (offset of "On" in (do shell script "networksetup -getairportpower en0")) > 0 then
do shell script "networksetup -setairportpower en0 off"
do shell script "networksetup -setairportpower en0 on"
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment