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
40 echo $dev > /sys
/class
/leds
/${sysfs}/device_name
41 echo $mode > /sys
/class
/leds
/${sysfs}/mode
46 [ -n "$delayon" ] && \
47 echo $delayon > /sys
/class
/leds
/${sysfs}/delay_on
48 [ -n "$delayoff" ] && \
49 echo $delayoff > /sys
/class
/leds
/${sysfs}/delay_off
54 echo $dev > /sys
/class
/leds
/${sysfs}/device_name
55 echo $interval > /sys
/class
/leds
/${sysfs}/activity_interval
60 [ -n "$port_state" ] && \
61 echo $port_state > /sys
/class
/leds
/${sysfs}/port_state
67 config_get port_mask
$1 port_mask
68 [ -n "$port_mask" ] && \
69 echo $port_mask > /sys
/class
/leds
/${sysfs}/port_mask
76 [ -e /sys
/class
/leds
/ ] && {
78 config_foreach load_led led