]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
leds: disable all led's at halt.
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 19 Dec 2012 21:55:58 +0000 (22:55 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 19 Dec 2012 21:55:58 +0000 (22:55 +0100)
src/initscripts/init.d/halt
src/initscripts/init.d/mountfs

index 01f7234ef404f5d86e90a9fc2ef5ea6e00147731..a3005c9903632f592e04fb22b2bc5bc2f5fc8767 100644 (file)
@@ -21,8 +21,16 @@ case "${1}" in
                boot_mesg "Remount root readonly..."
                mount -f -o remount,ro / > /dev/null 2>&1
                evaluate_retval
+
                boot_mesg "Prepare for halt..."
                sleep 2
+
+               #Disable all leds at shutdown
+               for led in $(ls /sys/class/leds); do
+                       echo "none" > /sys/class/leds/$led/trigger
+                       echo "0"    > /sys/class/leds/$led/brightness
+               done
+
                halt -d -f -i -p
                ;;
        *)
index c56100979f1d1f4271212553fa80eb3ac92acabb..d4735d596ac96a4d73633b8a2010ba2991230cdc 100644 (file)
@@ -49,8 +49,10 @@ case "${1}" in
                boot_mesg "Unmounting all other currently mounted file systems..."
                umount -a -d -r &>/dev/null
                evaluate_retval
-               ;;
 
+               # mount /sys again for led control at halt
+               mount /sys 2>&1 >/dev/null
+               ;;
        *)
                echo "Usage: ${0} {start|stop}"
                exit 1