From db79fb81502c935be1295c258fb4738dfb2351bd Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Wed, 23 Sep 2020 17:34:44 +0200
Subject: [PATCH 10/43] base-files: add support for v4.4 style netdev led
 triggers

Current owrt scripting cant handle the old v4.4 style sysfs API of led
netdev triggers.

Signed-off-by: John Crispin <john@phrozen.org>
---
 package/base-files/files/etc/init.d/led | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index 277fb4e76f..8d97515d52 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -71,6 +71,8 @@ load_led() {
 		"netdev")
 			[ -n "$dev" ] && {
 				echo $dev > /sys/class/leds/${sysfs}/device_name
+				[ -e "/sys/class/leds/${sysfs}/mode" ]  && \
+					echo $mode > /sys/class/leds/${sysfs}/mode
 				for m in $mode; do
 					[ -e "/sys/class/leds/${sysfs}/$m" ] && \
 						echo 1 > /sys/class/leds/${sysfs}/$m
-- 
2.25.1

