rpcd: iwinfo plugin fixes
[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-audi)
16                 status_led="audi:green:power"
17                 ;;
18         linksys-viper)
19                 status_led="viper:white:health"
20                 ;;
21         esac
22 }
23
24 set_state() {
25         get_status_led
26
27         case "$1" in
28         preinit)
29                 status_led_blink_preinit
30                 ;;
31         failsafe)
32                 status_led_blink_failsafe
33                 ;;
34         preinit_regular)
35                 status_led_blink_preinit_regular
36                 ;;
37         done)
38                 status_led_on
39                 ;;
40         esac
41 }