From 404cad64709fbe3794f9116fb7c35708027d2ac8 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sun, 31 Jul 2022 10:11:58 +0200 Subject: [PATCH] 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 --- 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 732ac59a84f..08a1e6df3bb 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 -- 2.30.2