Skip to content

Instantly share code, notes, and snippets.

@happypeter
Created September 5, 2012 06:42
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 happypeter/3631908 to your computer and use it in GitHub Desktop.
Save happypeter/3631908 to your computer and use it in GitHub Desktop.
quick apple script to restart Airport
#!/usr/bin/env bash
####################################################################
#
# my iMac drop connections sometimes, a quick restart bring it back
#
####################################################################
networksetup -setairportpower en1 off
echo "NOW:" `networksetup -getairportpower en1`
networksetup -setairportpower en1 on
echo "NOW:" `networksetup -getairportpower en1`
# even when I am using wifi, but when I check with `ifconfig`, it is still `en1` that holds the IP
# so check ifconfig, if you don't know if you should put "en1" or whatever
# here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment