summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-12-27 03:38:56 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-12-27 03:38:56 +0000
commitd4e32f54df644e4a16d0fba0ab966a4b57ae3ac3 (patch)
treef223b6570a277949d35dc2b06c92f9f7cd55388c /usr
parentbd997551c058eedf3e17b76337f2c85f66914861 (diff)
downloadpfsense-d4e32f54df644e4a16d0fba0ab966a4b57ae3ac3.zip
pfsense-d4e32f54df644e4a16d0fba0ab966a4b57ae3ac3.tar.gz
Detect vmware and embedded platforms and lower the note duration
automatically.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/bin/beep.sh44
1 files changed, 28 insertions, 16 deletions
diff --git a/usr/local/bin/beep.sh b/usr/local/bin/beep.sh
index 916d11a..99962af 100755
--- a/usr/local/bin/beep.sh
+++ b/usr/local/bin/beep.sh
@@ -1,20 +1,32 @@
#!/bin/sh
-if [ -c "/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
+# Standard note length
+NOTELENGTH="25"
+# Embedded uses 100HZ
+if [ "$PFSENSETYPE" = "embedded" ]; then
+ NOTELENGTH="10"
+fi
+
+# Check for different HZ
+HZ=`cat /boot/loader.conf | grep kern.hz | wc -l | awk '{ print $1 }'`
+if [ "$HZ" = "1" ]; then
+ NOTELENGTH="10"
+fi
+
+if [ -c "/dev/speaker" ]; then
+ if [ "$1" = "start" ]; then
+ /usr/local/bin/beep -p 500 $NOTELENGTH
+ /usr/local/bin/beep -p 400 $NOTELENGTH
+ /usr/local/bin/beep -p 600 $NOTELENGTH
+ /usr/local/bin/beep -p 800 $NOTELENGTH
+ /usr/local/bin/beep -p 800 $NOTELENGTH
+ fi
+ if [ "$1" = "stop" ]; then
+ /usr/local/bin/beep -p 600 $NOTELENGTH
+ /usr/local/bin/beep -p 800 $NOTELENGTH
+ /usr/local/bin/beep -p 500 $NOTELENGTH
+ /usr/local/bin/beep -p 400 $NOTELENGTH
+ /usr/local/bin/beep -p 400 $NOTELENGTH
+ fi
fi \ No newline at end of file
OpenPOWER on IntegriCloud