91cb8cf78eef96133f75b4830c8d37b70e52c44d
[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 esac
24 }
25
26 set_state() {
27 get_status_led
28
29 case "$1" in
30 preinit)
31 status_led_blink_preinit
32 ;;
33 failsafe)
34 status_led_blink_failsafe
35 ;;
36 preinit_regular)
37 status_led_blink_preinit_regular
38 ;;
39 done)
40 status_led_on
41 ;;
42 esac
43 }