ar71xx: add user-space support for GL.iNet v1
[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 gl-inet)
73 status_led="gl-connect:green:lan"
74 ;;
75 hiwifi-hc6361)
76 status_led="hiwifi:blue:system"
77 ;;
78 hornet-ub)
79 status_led="alfa:blue:wps"
80 ;;
81 ja76pf | \
82 ja76pf2)
83 status_led="jjplus:green:led1"
84 ;;
85 ls-sr71)
86 status_led="ubnt:green:d22"
87 ;;
88 mr600)
89 status_led="mr600:orange:power"
90 ;;
91 mr600v2)
92 status_led="mr600:blue:power"
93 ;;
94 mynet-n600 | \
95 mynet-n750)
96 status_led="wd:blue:power"
97 ;;
98 mynet-rext)
99 status_led="wd:blue:power"
100 ;;
101 mzk-w04nu | \
102 mzk-w300nh)
103 status_led="planex:green:status"
104 ;;
105 nbg460n_550n_550nh)
106 status_led="nbg460n:green:power"
107 ;;
108 nbg6716)
109 status_led="nbg6716:white:power"
110 ;;
111 om2p | \
112 om2pv2 | \
113 om2p-hs | \
114 om2p-hsv2 | \
115 om2p-lc)
116 status_led="om2p:blue:power"
117 ;;
118 pb44)
119 status_led="pb44:amber:jump1"
120 ;;
121 rb-2011l|\
122 rb-2011uas|\
123 rb-2011uas-2hnd)
124 status_led="rb:green:usr"
125 ;;
126 rb-411 | rb-411u | rb-433 | rb-433u | rb-450 | rb-450g | rb-493)
127 status_led="rb4xx:yellow:user"
128 ;;
129 rb-750)
130 status_led="rb750:green:act"
131 ;;
132 rb-911g-2hpnd|\
133 rb-911g-5hpnd|\
134 rb-912uag-2hpnd|\
135 rb-912uag-5hpnd)
136 status_led="rb:green:user"
137 ;;
138 rb-951ui-2hnd)
139 status_led="rb:green:act"
140 ;;
141 rb-sxt2n|\
142 rb-sxt5n)
143 status_led="rb:green:power"
144 ;;
145 routerstation | routerstation-pro)
146 status_led="ubnt:green:rf"
147 ;;
148 rw2458n)
149 status_led="rw2458n:green:d3"
150 ;;
151 oolite)
152 status_led="oolite:red:system"
153 ;;
154 tew-632brp)
155 status_led="tew-632brp:green:status"
156 ;;
157 tew-673gru)
158 status_led="trendnet:blue:wps"
159 ;;
160 tew-712br|\
161 tew-732br)
162 status_led="trendnet:green:power"
163 ;;
164 tl-mr3020)
165 status_led="tp-link:green:wps"
166 ;;
167 tl-wa750re)
168 status_led="tp-link:orange:re"
169 ;;
170 tl-wa850re)
171 status_led="tp-link:blue:re"
172 ;;
173 tl-wa860re)
174 status_led="tp-link:green:power"
175 ;;
176 tl-mr3220 | \
177 tl-mr3220-v2 | \
178 tl-mr3420 | \
179 tl-mr3420-v2 | \
180 tl-wa801nd-v2 | \
181 tl-wa901nd | \
182 tl-wa901nd-v2 | \
183 tl-wa901nd-v3 | \
184 tl-wdr3500 | \
185 tl-wr1041n-v2 | \
186 tl-wr1043nd | \
187 tl-wr1043nd-v2 | \
188 tl-wr741nd | \
189 tl-wr741nd-v4 | \
190 tl-wr841n-v1 | \
191 tl-wr841n-v7 | \
192 tl-wr841n-v8 | \
193 tl-wa830re-v2 | \
194 tl-wr842n-v2 | \
195 tl-wr941nd)
196 status_led="tp-link:green:system"
197 ;;
198 archer-c7 | \
199 tl-wdr4900-v2 | \
200 tl-mr10u | \
201 tl-mr13u | \
202 tl-wdr4300 | \
203 tl-wr703n | \
204 tl-wr710n | \
205 tl-wr720n-v3)
206 status_led="tp-link:blue:system"
207 ;;
208 tl-wr841n-v9)
209 status_led="tp-link:green:qss"
210 ;;
211 tl-wr2543n)
212 status_led="tp-link:green:wps"
213 ;;
214 unifi)
215 status_led="ubnt:green:dome"
216 ;;
217 uap-pro)
218 status_led="ubnt:white:dome"
219 ;;
220 whr-g301n | \
221 whr-hp-g300n | \
222 whr-hp-gn | \
223 wzr-hp-g300nh)
224 status_led="buffalo:green:router"
225 ;;
226 wlae-ag300n)
227 status_led="buffalo:green:status"
228 ;;
229 wzr-hp-ag300h | \
230 wzr-hp-g300nh2)
231 status_led="buffalo:red:diag"
232 ;;
233 wndap360 | \
234 wndr3700 | \
235 wndr4300 | \
236 wnr2000 | \
237 wnr2200 |\
238 wnr612-v2)
239 status_led="netgear:green:power"
240 ;;
241 wp543)
242 status_led="wp543:green:diag"
243 ;;
244 wrt400n)
245 status_led="wrt400n:blue:wps"
246 ;;
247 wrt160nl)
248 status_led="wrt160nl:blue:wps"
249 ;;
250 zcn-1523h-2 | zcn-1523h-5)
251 status_led="zcn-1523h:amber:init"
252 ;;
253 wlr8100)
254 status_led="sitecom:amber:status"
255 ;;
256 esac
257 }
258
259 set_state() {
260 get_status_led
261
262 case "$1" in
263 preinit)
264 status_led_blink_preinit
265 ;;
266 failsafe)
267 status_led_blink_failsafe
268 ;;
269 done)
270 status_led_on
271 ;;
272 esac
273 }