diff options
author | Koen Kooi <koen@openembedded.org> | 2008-06-04 14:55:31 +0000 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2008-06-04 14:55:31 +0000 |
commit | 8f52b3e590811ca645c13219d9b9a9191476aec3 (patch) | |
tree | bc268a64a90ee6b21bac6c21c1ccd1ad30c421d7 /packages/angstrom/angstrom-led-config/led-config | |
parent | 2d0ed5c61d9bb342721c32c220ff2b4b53452446 (diff) |
angstrom led config: initscript that applies led config from /etc/default/leds
Diffstat (limited to 'packages/angstrom/angstrom-led-config/led-config')
-rwxr-xr-x | packages/angstrom/angstrom-led-config/led-config | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/packages/angstrom/angstrom-led-config/led-config b/packages/angstrom/angstrom-led-config/led-config new file mode 100755 index 0000000000..63d52d6cd0 --- /dev/null +++ b/packages/angstrom/angstrom-led-config/led-config @@ -0,0 +1,31 @@ +#! /bin/sh + +if [ -e /sys/class/leds/ ] ; then + +case "$1" in + start) + echo "Configuring leds:" + for led in /sys/class/leds/* ; do + trigger=$(grep "$(basename $led)" /etc/default/leds | awk '{print $2}') + if [ "x$trigger" = "x" ] ; then trigger="none" ; fi + echo " $(basename $led): $trigger" + echo "$trigger" > "$led/trigger" + done +;; + stop) + echo "Deconfiguring leds:" + for led in /sys/class/leds/* ; do + echo " $(basename $led): no trigger" + echo "none" > "$led/trigger" + done + ;; + *) + echo "Usage: /etc/init.d/led-config {start|stop}" + exit 1 +esac + +else + echo "No LEDs detected" +fi + +exit 0 |