aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2016-06-07 22:58:22 +0200
committerJo-Philipp Wich <jo@mein.io>2016-06-07 23:01:58 +0200
commit33a4d22f4cc76ef8e8eed19d3db1fd49a7937aaf (patch)
tree534ea281f237ca6bbc85ad7893ef2c6f44a4db37
parent21ad25f5478a6cfe9078930b3e42ff7af938144d (diff)
downloadupstream-33a4d22f4cc76ef8e8eed19d3db1fd49a7937aaf.tar.gz
upstream-33a4d22f4cc76ef8e8eed19d3db1fd49a7937aaf.tar.bz2
upstream-33a4d22f4cc76ef8e8eed19d3db1fd49a7937aaf.zip
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>
-rwxr-xr-xpackage/base-files/files/etc/init.d/led6
1 files changed, 6 insertions, 0 deletions
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
}