at91: convert boards to generic build target
[openwrt/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 status_led="status:orange:fault"
13 ;;
14 pogo_e02)
15 status_led="pogo_e02:orange:fault"
16 ;;
17 linksys-audi)
18 status_led="audi:green:power"
19 ;;
20 linksys-viper)
21 status_led="viper:white:health"
22 ;;
23 nsa310b)
24 status_led="nsa310:green:sys"
25 ;;
26 esac
27 }
28
29 set_state() {
30 get_status_led
31
32 case "$1" in
33 preinit)
34 status_led_blink_preinit
35 ;;
36 failsafe)
37 status_led_blink_failsafe
38 ;;
39 preinit_regular)
40 status_led_blink_preinit_regular
41 ;;
42 done)
43 status_led_on
44 ;;
45 esac
46 }