Skip to content

Instantly share code, notes, and snippets.

@nriley
Created November 23, 2011 22:06
Show Gist options
  • Save nriley/1390070 to your computer and use it in GitHub Desktop.
Save nriley/1390070 to your computer and use it in GitHub Desktop.
bluetooth switcher
#!/bin/zsh -f
dscacheutil -flushcache
# coproc scutil -Wr cmi.sabi.net
# until [[ $(read -pe) == Reachable* ]]; do
# dscacheutil -flushcache
# done
# kill $!
blueutil off
if [[ "$(ssh bw2 /usr/local/bin/blueutil status)" == 'Status: on' ]]; then
ssh bw2 /usr/local/bin/blueutil off
blueutil on
else
ssh bw2 /usr/local/bin/blueutil on
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment