0667ad29fe233c2c99f51b077cc6a877b90282fb
[openwrt/openwrt.git] / target / linux / kirkwood / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2014 OpenWrt.org
3
4 . /lib/functions.sh
5 . /lib/functions/leds.sh
6
7 get_status_led() {
8 case $(board_name) in
9 cisco,on100)
10 status_led="on100:green:health"
11 ;;
12 cloudengines,pogoe02)
13 status_led="pogo_e02:orange:fault"
14 ;;
15 cloudengines,pogoplugv4)
16 status_led="pogoplugv4:green:health"
17 ;;
18 linksys,audi)
19 status_led="audi:green:power"
20 ;;
21 linksys,viper)
22 status_led="viper:white:health"
23 ;;
24 seagate,dockstar|\
25 seagate,goflexhome|\
26 seagate,goflexnet)
27 status_led="status:orange:fault"
28 ;;
29 zyxel,nsa310b)
30 status_led="nsa310:green:sys"
31 ;;
32 esac
33 }
34
35 set_state() {
36 get_status_led
37
38 case "$1" in
39 preinit)
40 status_led_blink_preinit
41 ;;
42 failsafe)
43 status_led_blink_failsafe
44 ;;
45 preinit_regular)
46 status_led_blink_preinit_regular
47 ;;
48 done)
49 status_led_on
50 ;;
51 esac
52 }