Guest User

Untitled

a guest
Dec 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. attempt=0
  4. sleep 1
  5. while true; do
  6. rslt=$(timeout .5 parec --raw 2> /dev/null | od -N2 -td2 | head -n1)
  7. if [ "$rslt" = "0000000" ]; then
  8. if [ $attempt -lt 50 ]; then
  9. pacat /dev/null
  10. echo "wake attempt $attempt"
  11. attempt=$((attempt + 1))
  12. else
  13. sleep 1
  14. fi
  15. else
  16. attempt=0
  17. sleep 1
  18. fi
  19. done
Add Comment
Please, Sign In to add comment