- [ "$trigger" == "netdev" -a -n "$dev" ] && {
- [ -z "$mode" ] && mode=link
- echo $dev > /sys/class/leds/${sysfs}/device_name
- echo $mode > /sys/class/leds/${sysfs}/mode
- }
- [ "$trigger" == "timer" ] && {
- [ -n "$delayon" ] && echo $delayon > /sys/class/leds/${sysfs}/delay_on
- [ -n "$delayoff" ] && echo $delayoff > /sys/class/leds/${sysfs}/delay_off
- }
+ case "$trigger" in
+ "netdev")
+ [ -n "$dev" ] && {
+ echo $dev > /sys/class/leds/${sysfs}/device_name
+ echo $mode > /sys/class/leds/${sysfs}/mode
+ }
+ ;;
+
+ "timer")
+ [ -n "$delayon" ] && \
+ echo $delayon > /sys/class/leds/${sysfs}/delay_on
+ [ -n "$delayoff" ] && \
+ echo $delayoff > /sys/class/leds/${sysfs}/delay_off
+ ;;
+
+ "usbdev")
+ [ -n "$dev" ] && {
+ echo $dev > /sys/class/leds/${sysfs}/device_name
+ echo $interval > /sys/class/leds/${sysfs}/activity_interval
+ }
+ ;;
+
+ "port_state")
+ [ -n "$port_state" ] && \
+ echo $port_state > /sys/class/leds/${sysfs}/port_state
+ ;;
+
+ switch[0-9]*)
+ local port_mask
+
+ config_get port_mask $1 port_mask
+ [ -n "$port_mask" ] && \
+ echo $port_mask > /sys/class/leds/${sysfs}/port_mask
+ ;;
+ esac