Advertisement
Guest User

Untitled

a guest
Apr 20th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Maximum number of attempts to enable hcismd to try to get
  4. # hci0 to come online. Writing to sysfs too early seems to
  5. # not work, so we loop.
  6. MAXTRIES=25
  7.  
  8. seq 1 $MAXTRIES | while read i ; do
  9. echo 1 > /sys/module/hci_smd/parameters/hcismd_set
  10. if [ -e /sys/class/bluetooth/hci0 ] ; then
  11. # found hci0, exit successfully
  12. exit 0
  13. fi
  14. sleep 2
  15. if [ $i == $MAXTRIES ] ; then
  16. # must have gotten through all our retries, fail
  17. exit 1
  18. fi
  19. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement