diff options
-rwxr-xr-x | usr/local/bin/beep.sh | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/usr/local/bin/beep.sh b/usr/local/bin/beep.sh index 9001abf..9efdd25 100755 --- a/usr/local/bin/beep.sh +++ b/usr/local/bin/beep.sh @@ -1,17 +1,20 @@ #!/bin/sh -if [ "$1" = "start" ]; then - /usr/local/bin/beep -p 500 200 - /usr/local/bin/beep -p 400 200 - /usr/local/bin/beep -p 600 200 - /usr/local/bin/beep -p 800 200 - /usr/local/bin/beep -p 800 200 -fi -if [ "$1" = "stop" ]; then - /usr/local/bin/beep -p 600 200 - /usr/local/bin/beep -p 800 200 - /usr/local/bin/beep -p 500 200 - /usr/local/bin/beep -p 400 200 - /usr/local/bin/beep -p 400 200 -fi +if [ -f "/dev/speaker" ]; then + + if [ "$1" = "start" ]; then + /usr/local/bin/beep -p 500 200 + /usr/local/bin/beep -p 400 200 + /usr/local/bin/beep -p 600 200 + /usr/local/bin/beep -p 800 200 + /usr/local/bin/beep -p 800 200 + fi + if [ "$1" = "stop" ]; then + /usr/local/bin/beep -p 600 200 + /usr/local/bin/beep -p 800 200 + /usr/local/bin/beep -p 500 200 + /usr/local/bin/beep -p 400 200 + /usr/local/bin/beep -p 400 200 + fi +fi
\ No newline at end of file |