From 33a4d22f4cc76ef8e8eed19d3db1fd49a7937aaf Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 7 Jun 2016 22:58:22 +0200 Subject: [PATCH] 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 --- package/base-files/files/etc/init.d/led | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index d1521a9a61..a6be788a5e 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -103,6 +103,12 @@ load_led() { start() { [ -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_foreach load_led led } -- 2.25.1