Simple image host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

monbell 403B

1234567891011121314151617181920
  1. #!/bin/bash
  2. while true; do
  3. # Read, ignoring escapes, until the first bell char if
  4. # no bell is received in 10 seconds, the script loops
  5. read -r -d $(printf "\007") -t 10;
  6. code=$?
  7. # If the code is a timeout error, continue
  8. if [[ $code > 128 ]]; then
  9. continue
  10. # If read returned eof, suicide
  11. elif [[ $code != 0 ]]; then
  12. exit 0
  13. fi
  14. # If read returned success, run user's command
  15. $1
  16. done;