50b6ff24ca839fcd4d3f11d50809c1d424f1ab49
[openwrt/openwrt.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 3g150b | 3g300m | w150m)
13 status_led="tenda:blue:ap"
14 ;;
15 ai-br100)
16 status_led="aigale:blue:wlan"
17 ;;
18 ar670w)
19 status_led="ar670w:green:power"
20 ;;
21 ar725w)
22 status_led="ar725w:green:power"
23 ;;
24 awapn2403)
25 status_led="asiarf:green:wps"
26 ;;
27 argus-atp52b)
28 status_led="argus-atp52b:green:run"
29 ;;
30 asl26555)
31 status_led="asl26555:green:power"
32 ;;
33 br6524n)
34 status_led="edimax:blue:power"
35 ;;
36 br6425 | br-6475nd)
37 status_led="edimax:green:power"
38 ;;
39 cy-swr1100)
40 status_led="samsung:blue:wps"
41 ;;
42 d105)
43 status_led="d105:red:power"
44 ;;
45 dcs-930 | dir-300-b1 | dir-600-b1 | dir-600-b2 | dir-610-a1 | dir-615-h1 | dir-615-d | dir-620-a1| dir-620-d1| dir-300-b7| dir-320-b1)
46 status_led="d-link:green:status"
47 ;;
48 dir-645)
49 status_led="d-link:green:wps"
50 ;;
51 dap-1350)
52 status_led="d-link:blue:power"
53 ;;
54 e1700)
55 status_led="linksys:green:power"
56 ;;
57 esr-9753)
58 status_led="esr-9753:orange:power"
59 ;;
60 f5d8235-v2)
61 status_led="f5d8235v2:blue:router"
62 ;;
63 fonera20n)
64 status_led="fonera20n:green:power"
65 ;;
66 ip2202)
67 status_led="ip2202:green:run"
68 ;;
69 rt-n13u)
70 status_led="rt-n13u:power"
71 ;;
72 hlk-rm04)
73 status_led="hlk-rm04:red:power"
74 ;;
75 ht-tm02)
76 status_led="ht-tm02:blue:wlan"
77 ;;
78 all0239-3g|\
79 hw550-3g)
80 status_led="hw550-3g:green:status"
81 ;;
82 m2m)
83 status_led="m2m:blue:wifi"
84 ;;
85 m3)
86 status_led="m3:blue:status"
87 ;;
88 m4)
89 status_led="m4:blue:status"
90 ;;
91 mlw221|\
92 mlwg2)
93 status_led="kingston:blue:system"
94 ;;
95 mofi3500-3gn)
96 status_led="mofi3500-3gn:green:status"
97 ;;
98 mpr-a1)
99 status_led="hame:red:power"
100 ;;
101 mpr-a2)
102 status_led="hame:red:power"
103 ;;
104 nbg-419n)
105 status_led="nbg-419n:green:power"
106 ;;
107 nw718)
108 status_led="nw718:amber:cpu"
109 ;;
110 omni-emb|\
111 omni-emb-hpm)
112 status_led="emb:green:status"
113 ;;
114 psr-680w)
115 status_led="psr-680w:red:wan"
116 ;;
117 pwh2004)
118 status_led="pwh2004:green:power"
119 ;;
120 px4885)
121 status_led="7links:orange:wifi"
122 ;;
123 rt-n15)
124 status_led="rt-n15:blue:power"
125 ;;
126 rt-n10-plus)
127 status_led="asus:green:wps"
128 ;;
129 rt-n56u | wl-330n | wl-330n3g)
130 status_led="asus:blue:power"
131 ;;
132 rut5xx)
133 status_led="rut5xx:green:status"
134 ;;
135 sl-r7205)
136 status_led="sl-r7205:green:status"
137 ;;
138 tew-691gr|\
139 tew-692gr)
140 status_led="trendnet:green:wps"
141 ;;
142 v11st-fe)
143 status_led="v11st-fe:green:status"
144 ;;
145 v22rw-2x2)
146 status_led="v22rw-2x2:green:security"
147 ;;
148 vocore)
149 status_led="vocore:green:status"
150 ;;
151 w306r-v20)
152 status_led="w306r-v20:green:sys"
153 ;;
154 w502u)
155 status_led="alfa:blue:wps"
156 ;;
157 wcr-150gn)
158 status_led="wcr150gn:amber:power"
159 ;;
160 whr-g300n)
161 status_led="whr-g300n:green:router"
162 ;;
163 wmr300 | \
164 whr-300hp2 | \
165 whr-600d)
166 status_led="buffalo:green:status"
167 ;;
168 wli-tx4-ag300n)
169 status_led="buffalo:blue:power"
170 ;;
171 wzr-agl300nh)
172 status_led="buffalo:green:router"
173 ;;
174 wl-351)
175 status_led="wl-351:amber:power"
176 ;;
177 wr512-3gn)
178 status_led="wr512:green:wps"
179 ;;
180 wr8305rt)
181 status_led="wr8305rt:sys"
182 ;;
183 wsr-600 | \
184 wsr-1166)
185 status_led="buffalo:orange:diag"
186 ;;
187 wnce2001)
188 status_led="netgear:green:power"
189 ;;
190 nexx-wt1520)
191 status_led="nexx-wt1520:white:power"
192 ;;
193 wt3020)
194 status_led="nexx:blue:power"
195 ;;
196 mzk-w300nh2)
197 status_led="mzkw300nh2:green:power"
198 ;;
199 ur-326n4g)
200 status_led="ur326:green:wps"
201 ;;
202 ur-336un)
203 status_led="ur336:green:wps"
204 ;;
205 x5)
206 status_led="x5:green:power"
207 ;;
208 x8)
209 status_led="x8:green:power"
210 ;;
211 xdxrn502j)
212 status_led="xdxrn502j:green:power"
213 ;;
214 xiaomi-mini)
215 status_led="xiaomi:red:status"
216 ;;
217 f7c027)
218 status_led="belkin:orange:status"
219 ;;
220 na930)
221 status_led="na930:blue:power"
222 ;;
223 y1 | \
224 y1s)
225 status_led="lenovo:blue:power"
226 ;;
227 esac
228 }
229
230 set_state() {
231 get_status_led
232
233 case "$1" in
234 preinit)
235 status_led_blink_preinit
236 ;;
237 failsafe)
238 status_led_blink_failsafe
239 ;;
240 preinit_regular)
241 status_led_blink_preinit_regular
242 ;;
243 done)
244 status_led_on
245 ;;
246 esac
247 }