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