From: John Crispin Date: Fri, 23 Jan 2015 12:33:04 +0000 (+0000) Subject: base-files: fix led script to skip missing triggers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae;p=openwrt%2Fstaging%2Faparcar.git base-files: fix led script to skip missing triggers this is based on http://patchwork.ozlabs.org/patch/424451/ Signed-off-by: John Crispin SVN-Revision: 44087 --- diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index d2310f019d..6962bfa843 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -40,7 +40,11 @@ load_led() { [ $default -eq 1 ] || echo 0 >/sys/class/leds/${sysfs}/brightness } - echo $trigger > /sys/class/leds/${sysfs}/trigger + echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null + [ $? = 0 ] || { + echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module" + return 1 + } case "$trigger" in "netdev") [ -n "$dev" ] && {