summaryrefslogtreecommitdiff
path: root/packages/slugos-init/files/initscripts/zleds
diff options
context:
space:
mode:
Diffstat (limited to 'packages/slugos-init/files/initscripts/zleds')
-rw-r--r--packages/slugos-init/files/initscripts/zleds23
1 files changed, 20 insertions, 3 deletions
diff --git a/packages/slugos-init/files/initscripts/zleds b/packages/slugos-init/files/initscripts/zleds
index f5bd703b65..4c8277a53d 100644
--- a/packages/slugos-init/files/initscripts/zleds
+++ b/packages/slugos-init/files/initscripts/zleds
@@ -21,8 +21,25 @@ state(){
esac
}
+# trumpet "beeps" an announcement on systems with such support.
+l=120 # Long beep time
+s=40 # Try to keep a 3:1 ratio
+trumpet(){
+ case "$1" in
+ k) leds beep -l $l; leds beep -l $s; leds beep -l $l;;
+ n) leds beep -l $l; leds beep -l $s;;
+ *) leds beep;;
+ esac
+}
+
case "$1" in
-start) leds "$(state "$runlevel")";;
-stop) leds boot "$(state "$runlevel")";;
-*) echo "led change: $1: command ignored" >&2;;
+start) leds "$(state "$runlevel")"
+ if [ "$(state "$runlevel")" == "user" ]; then
+ trumpet "k"
+ fi
+ ;;
+stop) leds boot "$(state "$runlevel")"
+ ;;
+*) echo "led change: $1: command ignored" >&2
+ ;;
esac