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@schinagl.nl>
This commit is contained in:
Olliver Schinagl 2022-07-31 10:11:58 +02:00 committed by Hauke Mehrtens
parent b8f27251c9
commit 404cad6470
1 changed files with 4 additions and 0 deletions

View File

@ -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