Created
April 18, 2019 17:49
-
-
Save gingerbeardman/314aca507c2c7abfc6507bfc12c6fd9b to your computer and use it in GitHub Desktop.
Cycle Bluetooth & Wi-Fi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires https://github.com/toy/blueutil to be installed