lantiq: add Buffalo WBMR-300HPD support
[openwrt/openwrt.git] / target / linux / lantiq / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2010-2015 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/functions/lantiq.sh
6
7 boot="$(lantiq_get_dt_led_chosen boot)"
8 failsafe="$(lantiq_get_dt_led_chosen failsafe)"
9 running="$(lantiq_get_dt_led_chosen running)"
10
11 set_state() {
12 status_led="$boot"
13
14 case "$1" in
15 preinit)
16 status_led_blink_preinit
17 ;;
18 failsafe)
19 status_led_off
20 status_led="$failsafe"
21 status_led_blink_failsafe
22 ;;
23 preinit_regular)
24 status_led_blink_preinit_regular
25 ;;
26 done)
27 status_led_off
28 [ -n "$running" ] && {
29 status_led="$running"
30 status_led_on
31 }
32 ;;
33 esac
34 }