1 #!/bin/sh /etc/rc.common
16 config_get name
$1 name
17 config_get sysfs
$1 sysfs
18 config_get trigger
$1 trigger
20 config_get mode
$1 mode
21 config_get default
$1 default
22 config_get delayon
$1 delayon
23 config_get delayoff
$1 delayoff
25 [ -e /sys
/class
/leds
/${sysfs}/brightness
] && {
26 logger
"setting up led : ${name:-$sysfs}"
27 [ -n "$default" ] && {
29 echo 1 >/sys
/class
/leds
/${sysfs}/brightness
31 echo 0 >/sys
/class
/leds
/${sysfs}/brightness
33 [ -z "$trigger" ] && trigger
=none
34 echo $trigger > /sys
/class
/leds
/${sysfs}/trigger
35 [ "$trigger" == "netdev" -a -n "$dev" ] && {
36 [ -z "$mode" ] && mode
=link
37 echo $dev > /sys
/class
/leds
/${sysfs}/device_name
38 echo $mode > /sys
/class
/leds
/${sysfs}/mode
40 [ "$trigger" == "timer" ] && {
41 [ -n "$delayon" ] && echo $delayon > /sys
/class
/leds
/${sysfs}/delay_on
42 [ -n "$delayoff" ] && echo $delayoff > /sys
/class
/leds
/${sysfs}/delay_off
48 [ -e /sys
/class
/leds
/ ] && {
50 config_foreach load_led led