Guest User

Untitled

a guest
Apr 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. coproc bluetoothctl
  4.  
  5. echo -e 'scan on\n' >&${COPROC[1]}
  6. sleep 3
  7. echo -e 'remove AA:AA:AA:AA:AA:AA\n' >&${COPROC[1]}
  8. sleep 1
  9. echo -e 'pair AA:AA:AA:AA:AA:AA\n' >&${COPROC[1]}
  10. sleep 1
  11. echo -e 'connect AA:AA:AA:AA:AA:AA\n' >&${COPROC[1]}
  12. sleep 1
  13.  
  14. echo -e 'scan off\n' >&${COPROC[1]}
  15. echo -e 'exit\n' >&${COPROC[1]}
  16.  
  17. output=$(cat <&${COPROC[0]})
  18. echo $output
Add Comment
Please, Sign In to add comment