be825379f9f18d3671180275915f516740800ec6
[oweals/openwrt.git] / target / linux / mvebu / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2014-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-Project.org
4
5 . /lib/functions.sh
6 . /lib/functions/leds.sh
7
8 get_status_led() {
9         case $(board_name) in
10         linksys,caiman)
11                 status_led="caiman:white:power"
12                 ;;
13         linksys,cobra)
14                 status_led="cobra:white:power"
15                 ;;
16         linksys,mamba)
17                 status_led="mamba:white:power"
18                 ;;
19         linksys,rango)
20                 status_led="rango:white:power"
21                 ;;
22         linksys,shelby)
23                 status_led="shelby:white:power"
24                 ;;
25         linksys,venom)
26                 status_led="venom:blue:power"
27                 ;;
28         esac
29 }
30
31 set_state() {
32         get_status_led
33
34         case "$1" in
35         preinit)
36                 status_led_blink_preinit
37                 ;;
38         failsafe)
39                 status_led_blink_failsafe
40                 ;;
41         preinit_regular)
42                 status_led_blink_preinit_regular
43                 ;;
44         done)
45                 status_led_on
46                 ;;
47         esac
48 }