[openwrt/openwrt] base-files: LED/trigger/heartbeat: Add support for inversion

LEDE Commits lede-commits at lists.infradead.org
Sat Aug 6 10:59:04 PDT 2022


hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/404cad64709fbe3794f9116fb7c35708027d2ac8

commit 404cad64709fbe3794f9116fb7c35708027d2ac8
Author: Olliver Schinagl <oliver at schinagl.nl>
AuthorDate: Sun Jul 31 10:11:58 2022 +0200

    base-files: LED/trigger/heartbeat: Add support for inversion
    
    The heartbeat trigger has the option to be inverted, however
    openwrt/uci/luci have no way to set this.
    
    This patch adds this support.
    
    Signed-off-by: Olliver Schinagl <oliver at schinagl.nl>
---
 package/base-files/files/etc/init.d/led | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index 732ac59a84..08a1e6df3b 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -69,6 +69,10 @@ load_led() {
 			return 1
 		}
 		case "$trigger" in
+		"heartbeat")
+			echo "${inverted}" > "/sys/class/leds/${sysfs}/invert"
+			;;
+
 		"netdev")
 			[ -n "$dev" ] && {
 				echo $dev > /sys/class/leds/${sysfs}/device_name




More information about the lede-commits mailing list