1 #!/bin/sh /etc/rc.common
17 config_get sysfs
$1 sysfs
18 config_get name
$1 name
"$sysfs"
19 config_get trigger
$1 trigger
"none"
21 config_get mode
$1 mode
"link"
22 config_get_bool default
$1 default
"nil"
23 config_get delayon
$1 delayon
24 config_get delayoff
$1 delayoff
25 config_get interval
$1 interval
"50"
26 config_get port_state
$1 port_state
28 [ -e /sys
/class
/leds
/${sysfs}/brightness
] && {
29 echo "setting up led ${name}"
30 [ "$default" != nil
] && {
32 echo 1 >/sys
/class
/leds
/${sysfs}/brightness
34 echo 0 >/sys
/class
/leds
/${sysfs}/brightness
36 echo $trigger > /sys
/class
/leds
/${sysfs}/trigger
37 [ "$trigger" == "netdev" -a -n "$dev" ] && {
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
45 [ "$trigger" == "usbdev" -a -n "$dev" ] && {
46 echo $dev > /sys
/class
/leds
/${sysfs}/device_name
47 echo $interval > /sys
/class
/leds
/${sysfs}/activity_interval
49 [ "$trigger" == "port_state" -a -n "$port_state" ] && {
50 echo $port_state > /sys
/class
/leds
/${sysfs}/port_state
56 [ -e /sys
/class
/leds
/ ] && {
58 config_foreach load_led led