103dfcd23682382349324ffb11cc3153c18cd000
[openwrt/svn-archive/archive.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 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 m3)
83 status_led="m3:blue:status"
84 ;;
85 m4)
86 status_led="m4:blue:status"
87 ;;
88 mlw221)
89 status_led="kingston:blue:status"
90 ;;
91 mofi3500-3gn)
92 status_led="mofi3500-3gn:green:status"
93 ;;
94 mpr-a1)
95 status_led="hame:red:power"
96 ;;
97 mpr-a2)
98 status_led="hame:red:power"
99 ;;
100 nbg-419n)
101 status_led="nbg-419n:green:power"
102 ;;
103 nw718)
104 status_led="nw718:amber:cpu"
105 ;;
106 omni-emb|\
107 omni-emb-hpm)
108 status_led="emb:green:status"
109 ;;
110 psr-680w)
111 status_led="psr-680w:red:wan"
112 ;;
113 pwh2004)
114 status_led="pwh2004:green:power"
115 ;;
116 px4885)
117 status_led="7links:orange:wifi"
118 ;;
119 rt-n15)
120 status_led="rt-n15:blue:power"
121 ;;
122 rt-n10-plus)
123 status_led="asus:green:wps"
124 ;;
125 rt-n56u | wl-330n | wl-330n3g)
126 status_led="asus:blue:power"
127 ;;
128 rut5xx)
129 status_led="rut5xx:green:status"
130 ;;
131 sl-r7205)
132 status_led="sl-r7205:green:status"
133 ;;
134 tew-691gr|\
135 tew-692gr)
136 status_led="trendnet:green:wps"
137 ;;
138 v11st-fe)
139 status_led="v11st-fe:green:status"
140 ;;
141 v22rw-2x2)
142 status_led="v22rw-2x2:green:security"
143 ;;
144 vocore)
145 status_led="vocore:green:status"
146 ;;
147 w306r-v20)
148 status_led="w306r-v20:green:sys"
149 ;;
150 w502u)
151 status_led="alfa:blue:wps"
152 ;;
153 wcr-150gn)
154 status_led="wcr150gn:amber:power"
155 ;;
156 whr-g300n)
157 status_led="whr-g300n:green:router"
158 ;;
159 wmr300 | \
160 whr-300hp2 | \
161 whr-600d)
162 status_led="buffalo:green:status"
163 ;;
164 wli-tx4-ag300n)
165 status_led="buffalo:blue:power"
166 ;;
167 wl-351)
168 status_led="wl-351:amber:power"
169 ;;
170 wr512-3gn)
171 status_led="wr512:green:wps"
172 ;;
173 wr8305rt)
174 status_led="wr8305rt:sys"
175 ;;
176 wsr-600 | \
177 wsr-1166)
178 status_led="buffalo:orange:diag"
179 ;;
180 wnce2001)
181 status_led="netgear:green:power"
182 ;;
183 nexx-wt1520)
184 status_led="nexx-wt1520:white:power"
185 ;;
186 nexx-wt3020)
187 status_led="nexx:blue:power"
188 ;;
189 mzk-w300nh2)
190 status_led="mzkw300nh2:green:power"
191 ;;
192 ur-326n4g)
193 status_led="ur326:green:wps"
194 ;;
195 ur-336un)
196 status_led="ur336:green:wps"
197 ;;
198 x5)
199 status_led="x5:green:power"
200 ;;
201 x8)
202 status_led="x8:green:power"
203 ;;
204 xdxrn502j)
205 status_led="xdxrn502j:green:power"
206 ;;
207 f7c027)
208 status_led="belkin:orange:status"
209 ;;
210 na930)
211 status_led="na930:blue:power"
212 ;;
213 y1 | \
214 y1s)
215 status_led="lenovo:blue:power"
216 ;;
217 esac
218 }
219
220 set_state() {
221 get_status_led
222
223 case "$1" in
224 preinit)
225 status_led_blink_preinit
226 ;;
227 failsafe)
228 status_led_blink_failsafe
229 ;;
230 preinit_regular)
231 status_led_blink_preinit_regular
232 ;;
233 done)
234 status_led_on
235 ;;
236 esac
237 }