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