aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2022-07-31 10:11:58 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2022-08-06 19:58:46 +0200
commit404cad64709fbe3794f9116fb7c35708027d2ac8 (patch)
tree916687fb769ff8a299513e8657b4ff40fab7dcff /package/base-files/files
parentb8f27251c9f755f7219391daa0e15318a12972a3 (diff)
downloadupstream-404cad64709fbe3794f9116fb7c35708027d2ac8.tar.gz
upstream-404cad64709fbe3794f9116fb7c35708027d2ac8.tar.bz2
upstream-404cad64709fbe3794f9116fb7c35708027d2ac8.zip
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>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/init.d/led4
1 files changed, 4 insertions, 0 deletions
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