From: Hauke Mehrtens Date: Sun, 16 Dec 2018 15:51:26 +0000 (+0100) Subject: base-files: Fix netdev led trigger X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=201058b35ce42086b83f7eabb6304cac00c4c585;p=openwrt%2Fstaging%2Faparcar.git base-files: Fix netdev led trigger In the upstream netdev led trigger the one mode file was replaced by 3 files named rx, tx and link. Fix the netdev trigger configuration code to use the modified API. Fixes: aa3b6a08c56 ("kernel: Replace ledtrig-netdev with upstream backport") Reported-by: Hannu Nyman Signed-off-by: Hauke Mehrtens --- diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index a3f1224a1a..932a69a82b 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -71,7 +71,10 @@ load_led() { "netdev") [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name - echo "${mode:-link}" > /sys/class/leds/${sysfs}/mode + for m in $mode; do + [ -e "/sys/class/leds/${sysfs}/$m" ] && \ + echo 1 > /sys/class/leds/${sysfs}/$m + done echo $interval > /sys/class/leds/${sysfs}/interval } ;;