diff mbox series

base-files: disable LEDs if default state is undefined

Message ID 20200801204510.97493-1-mail@david-bauer.net
State Accepted
Headers show
Series base-files: disable LEDs if default state is undefined | expand

Commit Message

David Bauer Aug. 1, 2020, 8:45 p.m. UTC
Set the default state for LEDs to off. When a trigger is set, the
trigger will turn the LED automatically on.

Currently LEDs might stay on, e.g. when the LED trigger is set to a
netdev trigger and the interface is never activated or the 'none'
trigger is selected without setting the 'default' option to 0 and it's
set for the LED indicating the system running state.

Using off as a default value is also consistent with the documentation
in the OpenWrt wiki.

Signed-off-by: David Bauer <mail@david-bauer.net>
 package/base-files/files/etc/init.d/led | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series


diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index 932a69a82b..277fb4e76f 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -21,7 +21,7 @@  load_led() {
 	config_get dev $1 dev
 	config_get ports $1 port
 	config_get mode $1 mode
-	config_get_bool default $1 default "nil"
+	config_get_bool default $1 default "0"
 	config_get delayon $1 delayon
 	config_get delayoff $1 delayoff
 	config_get interval $1 interval "50"