diff options
author | John Crispin <john@openwrt.org> | 2015-01-23 12:33:04 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2015-01-23 12:33:04 +0000 |
commit | b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae (patch) | |
tree | a467461c7fff48a317ecea00077b9803316f5dfe /package/base-files/files/etc/init.d | |
parent | 255a680a993d5ff544bbb67d20d329ce170bfac8 (diff) | |
download | upstream-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
Diffstat (limited to 'package/base-files/files/etc/init.d')
-rwxr-xr-x | package/base-files/files/etc/init.d/led | 6 |
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" ] && { |