1 #!/bin/sh /etc/rc.common
18 config_get name
$1 name
19 config_get sysfs
$1 sysfs
20 config_get trigger
$1 trigger
22 config_get mode
$1 mode
23 config_get default
$1 default
24 config_get delayon
$1 delayon
25 config_get delayoff
$1 delayoff
27 [ -e /sys
/class
/leds
/${sysfs}/brightness
-a -n "$name" ] && {
28 logger
"setting up led : $name"
29 [ -n "$default" ] && {
31 echo 1 >/sys
/class
/leds
/${sysfs}/brightness \
32 ||
echo 0 >/sys
/class
/leds
/${sysfs}/brightness
34 [ -z "$trigger" ] && trigger
=none
35 echo $trigger > /sys
/class
/leds
/${sysfs}/trigger
36 [ "$trigger" == "netdev" -a -n "$dev" ] && {
37 [ -z "$mode" ] && mode
=link
38 echo $dev > /sys
/class
/leds
/${sysfs}/device_name
39 echo $mode > /sys
/class
/leds
/${sysfs}/mode
41 [ "$trigger" == "timer" ] && {
42 [ -n "$delayon" ] && echo $delayon > /sys
/class
/leds
/${sysfs}/delay_on
43 [ -n "$delayoff" ] && echo $delayoff > /sys
/class
/leds
/${sysfs}/delay_off
49 [ -e /sys
/class
/leds
/ ] && {
51 config_foreach load_led led