kirkwood: consistently use engineering board names
[openwrt.git] / target / linux / kirkwood / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2014 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/kirkwood.sh
6
7 get_status_led() {
8         case $(kirkwood_board_name) in
9         dockstar|\
10         goflexhome|\
11         goflexnet|\
12         pogo_e02)
13                 status_led="status:orange:fault"
14                 ;;
15         linksys-viper)
16                 status_led="viper:white:health"
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         failsafe)
29                 status_led_blink_failsafe
30                 ;;
31         preinit_regular)
32                 status_led_blink_preinit_regular
33                 ;;
34         done)
35                 status_led_on
36                 ;;
37         esac
38 }