Skip to content

Instantly share code, notes, and snippets.

@gingerbeardman
Created April 18, 2019 17:49
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 gingerbeardman/314aca507c2c7abfc6507bfc12c6fd9b to your computer and use it in GitHub Desktop.
Save gingerbeardman/314aca507c2c7abfc6507bfc12c6fd9b to your computer and use it in GitHub Desktop.
Cycle Bluetooth & Wi-Fi
DEVICE=$(networksetup -listallhardwareports | grep -A 2 -E "AirPort|Wi-Fi" | grep -m 1 -o -e en[0-9]);
# turn them off...
networksetup -setairportpower $DEVICE Off
./blueutil off
# ...and on again
networksetup -setairportpower $DEVICE On
./blueutil on
@gingerbeardman
Copy link
Author

Requires https://github.com/toy/blueutil to be installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment