apm821xx: add support for the Western Digital MyBook Live Series
[openwrt/openwrt.git] / target / linux / apm821xx / base-files / etc / diag.sh
1 #!/bin/sh
2
3 . /lib/functions/leds.sh
4 . /lib/apm821xx.sh
5
6 get_status_led() {
7 case $(apm821xx_board_name) in
8 mbl)
9 status_led="mbl:green:power"
10 ;;
11
12 mr24)
13 status_led="mr24:green:power"
14 ;;
15
16 *)
17 ;;
18 esac
19 }
20
21 set_state() {
22 get_status_led
23
24 case "$1" in
25 preinit)
26 status_led_blink_preinit
27 ;;
28
29 failsafe)
30 status_led_blink_failsafe
31 ;;
32
33 preinit_regular)
34 status_led_blink_preinit_regular
35 ;;
36
37 done)
38 status_led_on
39 ;;
40 esac
41 }