Browse Source

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 <[email protected]>
Olliver Schinagl 3 years ago
parent
commit
404cad6470
1 changed files with 4 additions and 0 deletions
  1. 4 0
      package/base-files/files/etc/init.d/led

+ 4 - 0
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