base-files: reset LED state

Attempt to reset all LED states before applying the UCI configuration to
avoid leaving disabled LEDs behind in lingering glowing state, e.g. when
changing the sysfs entry in the config from one hardware LED to another.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lede-17.01
Jo-Philipp Wich 2016-06-07 22:58:22 +02:00
parent 21ad25f547
commit 33a4d22f4c
1 changed files with 6 additions and 0 deletions

View File

@ -103,6 +103,12 @@ load_led() {
start() { start() {
[ -e /sys/class/leds/ ] && { [ -e /sys/class/leds/ ] && {
local led
for led in /sys/class/leds/*; do
[ -e "$led/trigger" ] && echo "none" > "$led/trigger"
[ -e "$led/brightness" ] && echo "0" > "$led/brightness"
done
config_load system config_load system
config_foreach load_led led config_foreach load_led led
} }