8022151378ca2fdcaf952a25f4fdd3c83e4612eb
[openwrt/openwrt.git] / target / linux / ath79 / base-files / etc / diag.sh
1 #!/bin/sh
2
3 . /lib/functions/leds.sh
4
5 get_status_led() {
6 local board=$(board_name)
7 local boardname="${board##*,}"
8
9 case $board in
10 "avm,fritz300e")
11 status_led="${boardname}:green:power"
12 ;;
13 "glinet,ar150")
14 status_led="gl-ar150:orange:wlan"
15 ;;
16 "tplink,tl-wr1043nd-v1")
17 status_led="tp-link:green:system"
18 ;;
19 "ubnt,unifi")
20 status_led="ubnt:green:dome"
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 }