ramips: fix HiWiFi HC5761A switch settings
[openwrt/staging/wigyori.git] / target / linux / brcm47xx / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 . /lib/functions/leds.sh
5
6 get_status_led() {
7 for led in dmz power diag wps; do
8 status_led_file=$(find /sys/class/leds/ -name "*${led}*" | head -n1)
9 if [ ! -f $status_led_file ]; then
10 status_led=$(basename $status_led_file)
11 return
12 fi;
13 done
14 }
15
16 set_state() {
17 get_status_led
18
19 case "$1" in
20 preinit)
21 status_led_blink_preinit
22 ;;
23 failsafe)
24 status_led_blink_failsafe
25 ;;
26 preinit_regular)
27 status_led_blink_preinit_regular
28 ;;
29 done)
30 status_led_on
31 ;;
32 esac
33 }