package/base-files: use case statement in led init script

SVN-Revision: 29628
This commit is contained in:
Gabor Juhos 2011-12-31 15:02:32 +00:00
parent 5fa65cba6e
commit 3f85c52a3a

View file

@ -34,21 +34,33 @@ load_led() {
echo 0 >/sys/class/leds/${sysfs}/brightness echo 0 >/sys/class/leds/${sysfs}/brightness
} }
echo $trigger > /sys/class/leds/${sysfs}/trigger echo $trigger > /sys/class/leds/${sysfs}/trigger
[ "$trigger" == "netdev" -a -n "$dev" ] && { case "$trigger" in
echo $dev > /sys/class/leds/${sysfs}/device_name "netdev")
echo $mode > /sys/class/leds/${sysfs}/mode [ -n "$dev" ] && {
} echo $dev > /sys/class/leds/${sysfs}/device_name
[ "$trigger" == "timer" ] && { echo $mode > /sys/class/leds/${sysfs}/mode
[ -n "$delayon" ] && echo $delayon > /sys/class/leds/${sysfs}/delay_on }
[ -n "$delayoff" ] && echo $delayoff > /sys/class/leds/${sysfs}/delay_off ;;
}
[ "$trigger" == "usbdev" -a -n "$dev" ] && { "timer")
echo $dev > /sys/class/leds/${sysfs}/device_name [ -n "$delayon" ] && \
echo $interval > /sys/class/leds/${sysfs}/activity_interval echo $delayon > /sys/class/leds/${sysfs}/delay_on
} [ -n "$delayoff" ] && \
[ "$trigger" == "port_state" -a -n "$port_state" ] && { echo $delayoff > /sys/class/leds/${sysfs}/delay_off
echo $port_state > /sys/class/leds/${sysfs}/port_state ;;
}
"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
;;
esac
} }
} }