aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2015-01-23 12:33:04 +0000
committerJohn Crispin <blogic@openwrt.org>2015-01-23 12:33:04 +0000
commitdda181d82ca09598c9c1088eb90317c6923dd24f (patch)
tree2a7939ca88d4f968e59e9fd9a6394b3eb814a841 /package/base-files/files
parent87b2ba2865e9b3ffbdf43cf75ad050b1e7e8dd63 (diff)
downloadupstream-dda181d82ca09598c9c1088eb90317c6923dd24f.tar.gz
upstream-dda181d82ca09598c9c1088eb90317c6923dd24f.tar.bz2
upstream-dda181d82ca09598c9c1088eb90317c6923dd24f.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> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44087 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/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 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" ] && {