f6c113e86fcc12875e00087ee96ed6af3388376c
[openwrt/svn-archive/archive.git] / target / linux / ar71xx / base-files / etc / diag.sh
1 #!/bin/sh
2 # Copyright (C) 2009-2013 OpenWrt.org
3
4 . /lib/functions/leds.sh
5 . /lib/ar71xx.sh
6
7 get_status_led() {
8 case $(ar71xx_board_name) in
9 alfa-nx)
10 status_led="alfa:green:led_8"
11 ;;
12 all0305)
13 status_led="eap7660d:green:ds4"
14 ;;
15 ap132)
16 status_led="ap132:green:status"
17 ;;
18 ap136-010|\
19 ap136-020)
20 status_led="ap136:green:status"
21 ;;
22 ap135-020)
23 status_led="ap135:green:status"
24 ;;
25 ap81)
26 status_led="ap81:green:status"
27 ;;
28 ap83)
29 status_led="ap83:green:power"
30 ;;
31 ap96)
32 status_led="ap96:green:led2"
33 ;;
34 aw-nr580)
35 status_led="aw-nr580:green:ready"
36 ;;
37 bullet-m | rocket-m | nano-m | nanostation-m)
38 status_led="ubnt:green:link4"
39 ;;
40 bxu2000n-2-a1)
41 status_led="bhu:green:status"
42 ;;
43 cap4200ag)
44 status_led="senao:green:pwr"
45 ;;
46 db120)
47 status_led="db120:green:status"
48 ;;
49 dir-505-a1 |\
50 dir-600-a1 |\
51 dir-615-e1 |\
52 dir-615-e4)
53 status_led="d-link:green:power"
54 ;;
55 dir-615-c1)
56 status_led="d-link:green:status"
57 ;;
58 dir-825-b1)
59 status_led="d-link:orange:power"
60 ;;
61 dir-825-c1 |\
62 dir-835-a1)
63 status_led="d-link:amber:power"
64 ;;
65 eap7660d)
66 status_led="eap7660d:green:ds4"
67 ;;
68 el-mini | \
69 el-m150)
70 status_led="EasyLink:green:system"
71 ;;
72 hiwifi-hc6361)
73 status_led="hiwifi:blue:system"
74 ;;
75 hornet-ub)
76 status_led="alfa:blue:wps"
77 ;;
78 ja76pf | \
79 ja76pf2)
80 status_led="jjplus:green:led1"
81 ;;
82 ls-sr71)
83 status_led="ubnt:green:d22"
84 ;;
85 mr600)
86 status_led="mr600:orange:power"
87 ;;
88 mr600v2)
89 status_led="mr600:blue:power"
90 ;;
91 mynet-n600 | \
92 mynet-n750)
93 status_led="wd:blue:power"
94 ;;
95 mynet-rext)
96 status_led="wd:blue:power"
97 ;;
98 mzk-w04nu | \
99 mzk-w300nh)
100 status_led="planex:green:status"
101 ;;
102 nbg460n_550n_550nh)
103 status_led="nbg460n:green:power"
104 ;;
105 nbg6716)
106 status_led="nbg6716:white:power"
107 ;;
108 om2p | \
109 om2pv2 | \
110 om2p-hs | \
111 om2p-hsv2 | \
112 om2p-lc)
113 status_led="om2p:blue:power"
114 ;;
115 pb44)
116 status_led="pb44:amber:jump1"
117 ;;
118 rb-2011l|\
119 rb-2011uas|\
120 rb-2011uas-2hnd)
121 status_led="rb:green:usr"
122 ;;
123 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
124 status_led="rb4xx:yellow:user"
125 ;;
126 rb-750)
127 status_led="rb750:green:act"
128 ;;
129 rb-911g-2hpnd|\
130 rb-911g-5hpnd|\
131 rb-912uag-2hpnd|\
132 rb-912uag-5hpnd)
133 status_led="rb:green:user"
134 ;;
135 rb-951ui-2hnd)
136 status_led="rb:green:act"
137 ;;
138 rb-sxt2n|\
139 rb-sxt5n)
140 status_led="rb:green:power"
141 ;;
142 routerstation | routerstation-pro)
143 status_led="ubnt:green:rf"
144 ;;
145 rw2458n)
146 status_led="rw2458n:green:d3"
147 ;;
148 oolite)
149 status_led="oolite:red:system"
150 ;;
151 tew-632brp)
152 status_led="tew-632brp:green:status"
153 ;;
154 tew-673gru)
155 status_led="trendnet:blue:wps"
156 ;;
157 tew-712br|\
158 tew-732br)
159 status_led="trendnet:green:power"
160 ;;
161 tl-mr3020)
162 status_led="tp-link:green:wps"
163 ;;
164 tl-wa750re)
165 status_led="tp-link:orange:re"
166 ;;
167 tl-wa850re)
168 status_led="tp-link:blue:re"
169 ;;
170 tl-wa860re)
171 status_led="tp-link:green:power"
172 ;;
173 tl-mr3220 | \
174 tl-mr3220-v2 | \
175 tl-mr3420 | \
176 tl-mr3420-v2 | \
177 tl-wa801nd-v2 | \
178 tl-wa901nd | \
179 tl-wa901nd-v2 | \
180 tl-wa901nd-v3 | \
181 tl-wdr3500 | \
182 tl-wr1041n-v2 | \
183 tl-wr1043nd | \
184 tl-wr1043nd-v2 | \
185 tl-wr741nd | \
186 tl-wr741nd-v4 | \
187 tl-wr841n-v1 | \
188 tl-wr841n-v7 | \
189 tl-wr841n-v8 | \
190 tl-wa830re-v2 | \
191 tl-wr842n-v2 | \
192 tl-wr941nd)
193 status_led="tp-link:green:system"
194 ;;
195 archer-c7 | \
196 tl-wdr4900-v2 | \
197 tl-mr10u | \
198 tl-mr13u | \
199 tl-wdr4300 | \
200 tl-wr703n | \
201 tl-wr710n | \
202 tl-wr720n-v3)
203 status_led="tp-link:blue:system"
204 ;;
205 tl-wr841n-v9)
206 status_led="tp-link:green:qss"
207 ;;
208 tl-wr2543n)
209 status_led="tp-link:green:wps"
210 ;;
211 unifi)
212 status_led="ubnt:green:dome"
213 ;;
214 uap-pro)
215 status_led="ubnt:white:dome"
216 ;;
217 whr-g301n | \
218 whr-hp-g300n | \
219 whr-hp-gn | \
220 wzr-hp-g300nh)
221 status_led="buffalo:green:router"
222 ;;
223 wlae-ag300n)
224 status_led="buffalo:green:status"
225 ;;
226 wzr-hp-ag300h | \
227 wzr-hp-g300nh2)
228 status_led="buffalo:red:diag"
229 ;;
230 wndap360 | \
231 wndr3700 | \
232 wndr4300 | \
233 wnr2000 | \
234 wnr2200 |\
235 wnr612-v2)
236 status_led="netgear:green:power"
237 ;;
238 wp543)
239 status_led="wp543:green:diag"
240 ;;
241 wrt400n)
242 status_led="wrt400n:blue:wps"
243 ;;
244 wrt160nl)
245 status_led="wrt160nl:blue:wps"
246 ;;
247 zcn-1523h-2 | zcn-1523h-5)
248 status_led="zcn-1523h:amber:init"
249 ;;
250 wlr8100)
251 status_led="sitecom:amber:status"
252 ;;
253 esac
254 }
255
256 set_state() {
257 get_status_led
258
259 case "$1" in
260 preinit)
261 status_led_blink_preinit
262 ;;
263 failsafe)
264 status_led_blink_failsafe
265 ;;
266 done)
267 status_led_on
268 ;;
269 esac
270 }