From 71a9178996e3d4f74a1a6a8b390acaf68d3a4a39 Mon Sep 17 00:00:00 2001 From: Mike Westerhof Date: Sun, 12 Aug 2007 01:53:26 +0000 Subject: zleds: announce via beeper when rc3.d scripts are completed (ssh login is ready). --- packages/slugos-init/files/initscripts/zleds | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'packages/slugos-init') 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 -- cgit 1.2.3-korg