0a5011a7aed9b91bdaf84c1c8fc1b4d1809afaa2
[openwrt/openwrt.git] / target / linux / ath79 / base-files / etc / diag.sh
1 #!/bin/sh
2
3 . /lib/functions/leds.sh
4
5 status_led="$(get_dt_led status)"
6
7 get_status_led() {
8 local board=$(board_name)
9 local boardname="${board##*,}"
10
11 case $board in
12 "avm,fritz300e")
13 status_led="${boardname}:green:power"
14 ;;
15 "embeddedwireless,dorin")
16 status_led="dorin:green:status"
17 ;;
18 "glinet,ar150")
19 status_led="gl-ar150:orange:wlan"
20 ;;
21 "tplink,tl-wr1043nd-v1")
22 status_led="tp-link:green:system"
23 ;;
24 "ubnt,unifi")
25 status_led="ubnt:green:dome"
26 ;;
27 esac
28 }
29
30 set_state() {
31 [ -z "$status_led" ] && get_status_led
32
33 case "$1" in
34 preinit)
35 status_led_blink_preinit
36 ;;
37 failsafe)
38 status_led_blink_failsafe
39 ;;
40 preinit_regular)
41 status_led_blink_preinit_regular
42 ;;
43 done)
44 status_led_on
45 ;;
46 esac
47 }