aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-01-23 12:33:04 +0000
committerJohn Crispin <john@openwrt.org>2015-01-23 12:33:04 +0000
commitb54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae (patch)
treea467461c7fff48a317ecea00077b9803316f5dfe
parent255a680a993d5ff544bbb67d20d329ce170bfac8 (diff)
downloadupstream-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.tar.gz
upstream-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.tar.bz2
upstream-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.zip
base-files: fix led script to skip missing triggers
this is based on http://patchwork.ozlabs.org/patch/424451/ Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 44087
-rwxr-xr-xpackage/base-files/files/etc/init.d/led6
1 files changed, 5 insertions, 1 deletions
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" ] && {