mvebu: add missing status LEDs for Linksys WRT1200AC and WRT1900ACv2
[librecmc/librecmc.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/leds.sh
6 . /lib/mvebu.sh
7
8 get_status_led() {
9         case $(mvebu_board_name) in
10         armada-385-linksys-caiman)
11                 status_led="caiman:white:power"
12                 ;;
13         armada-385-linksys-cobra)
14                 status_led="cobra:white:power"
15                 ;;
16         armada-385-linksys-shelby)
17                 status_led="shelby:white:power"
18                 ;;
19         armada-xp-linksys-mamba)
20                 status_led="mamba:white:power"
21                 ;;
22         esac
23 }
24
25 set_state() {
26         get_status_led
27
28         case "$1" in
29         preinit)
30                 status_led_blink_preinit
31                 ;;
32         failsafe)
33                 status_led_blink_failsafe
34                 ;;
35         preinit_regular)
36                 status_led_blink_preinit_regular
37                 ;;
38         done)
39                 status_led_on
40                 ;;
41         esac
42 }