summaryrefslogtreecommitdiff
path: root/package/base-files
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 /package/base-files
parent255a680a993d5ff544bbb67d20d329ce170bfac8 (diff)
downloadmtk-20170518-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.zip
mtk-20170518-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.tar.gz
mtk-20170518-b54f3ad6e7c44d3af65a7383f6bffcc0e7fc63ae.tar.bz2
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')
-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 d2310f0..6962bfa 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" ] && {