64650850d60e2660528c5a8fa39d33bb1833b0ed
[openwrt/staging/chunkeey.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 on100)
27 status_led="on100:green:health"
28 ;;
29 esac
30 }
31
32 set_state() {
33 get_status_led
34
35 case "$1" in
36 preinit)
37 status_led_blink_preinit
38 ;;
39 failsafe)
40 status_led_blink_failsafe
41 ;;
42 preinit_regular)
43 status_led_blink_preinit_regular
44 ;;
45 done)
46 status_led_on
47 ;;
48 esac
49 }