866003c28ce26f48f73e4ea203eb01aed3611a8e
[openwrt/staging/lynxis/omap.git] / target / linux / ramips / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2010-2013 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/ramips.sh
6
7 get_status_led() {
8 case $(ramips_board_name) in
9 3g-6200n)
10 status_led="edimax:green:power"
11 ;;
12 3g300m | w150m)
13 status_led="tenda:blue:ap"
14 ;;
15 argus-atp52b)
16 status_led="argus-atp52b:green:run"
17 ;;
18 br6524n)
19 status_led="edimax:blue:power"
20 ;;
21 br6425)
22 status_led="edimax:green:power"
23 ;;
24 d105)
25 status_led="d105:red:power"
26 ;;
27 dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-615-h1 | dir-615-d | dir-620-a1)
28 status_led="d-link:green:status"
29 ;;
30 dir-645)
31 status_led="d-link:green:wps"
32 ;;
33 dap-1350)
34 status_led="d-link:blue:power"
35 ;;
36 esr-9753)
37 status_led="esr-9753:orange:power"
38 ;;
39 f5d8235-v2)
40 status_led="f5d8235v2:blue:router"
41 ;;
42 fonera20n)
43 status_led="fonera20n:green:power"
44 ;;
45 rt-n13u)
46 status_led="rt-n13u:power"
47 ;;
48 all0239-3g|\
49 hw550-3g)
50 status_led="hw550-3g:green:status"
51 ;;
52 mofi3500-3gn)
53 status_led="mofi3500-3gn:green:status"
54 ;;
55 nbg-419n)
56 status_led="nbg-419n:green:power"
57 ;;
58 nw718)
59 status_led="nw718:amber:cpu"
60 ;;
61 omni-emb|\
62 omni-emb-hpm)
63 status_led="emb:green:status"
64 ;;
65 psr-680w)
66 status_led="psr-680w:red:wan"
67 ;;
68 pwh2004)
69 status_led="pwh2004:green:power"
70 ;;
71 rt-n15)
72 status_led="rt-n15:blue:power"
73 ;;
74 rt-n10-plus)
75 status_led="asus:green:wps"
76 ;;
77 rt-n56u | wl-330n | wl-330n3g)
78 status_led="asus:blue:power"
79 ;;
80 sl-r7205)
81 status_led="sl-r7205:green:status"
82 ;;
83 tew-691gr|\
84 tew-692gr)
85 status_led="trendnet:green:wps"
86 ;;
87 v11st-fe)
88 status_led="v11st-fe:green:status"
89 ;;
90 v22rw-2x2)
91 status_led="v22rw-2x2:green:security"
92 ;;
93 w306r-v20)
94 status_led="w306r-v20:green:sys"
95 ;;
96 w502u)
97 status_led="alfa:blue:wps"
98 ;;
99 wcr-150gn)
100 status_led="wcr150gn:amber:power"
101 ;;
102 whr-g300n)
103 status_led="whr-g300n:green:router"
104 ;;
105 wli-tx4-ag300n)
106 status_led="buffalo:blue:power"
107 ;;
108 wl-351)
109 status_led="wl-351:amber:power"
110 ;;
111 wr512-3gn)
112 status_led="wr512:green:wps"
113 ;;
114 mzk-w300nh2)
115 status_led="mzkw300nh2:green:power"
116 ;;
117 ur-326n4g)
118 status_led="ur326:green:wps"
119 ;;
120 ur-336un)
121 status_led="ur336:green:wps"
122 ;;
123 xdxrn502j)
124 status_led="xdxrn502j:green:power"
125 ;;
126 esac
127 }
128
129 set_state() {
130 get_status_led
131
132 case "$1" in
133 preinit)
134 insmod leds-gpio 2> /dev/null
135 status_led_blink_preinit
136 ;;
137 failsafe)
138 status_led_blink_failsafe
139 ;;
140 done)
141 status_led_on
142 ;;
143 esac
144 }