Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- attempt=0
- sleep 1
- while true; do
- rslt=$(timeout .5 parec --raw 2> /dev/null | od -N2 -td2 | head -n1)
- if [ "$rslt" = "0000000" ]; then
- if [ $attempt -lt 50 ]; then
- pacat /dev/null
- echo "wake attempt $attempt"
- attempt=$((attempt + 1))
- else
- sleep 1
- fi
- else
- attempt=0
- sleep 1
- fi
- done
Add Comment
Please, Sign In to add comment