122587232fb16a94ee65ca5a8a60a04d6b1f841a
[openwrt/staging/chunkeey.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 ar725w)
16 status_led="ar725w:green:power"
17 ;;
18 argus-atp52b)
19 status_led="argus-atp52b:green:run"
20 ;;
21 asl26555)
22 status_led="asl26555:green:power"
23 ;;
24 br6524n)
25 status_led="edimax:blue:power"
26 ;;
27 br6425 | br-6475nd)
28 status_led="edimax:green:power"
29 ;;
30 d105)
31 status_led="d105:red:power"
32 ;;
33 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)
34 status_led="d-link:green:status"
35 ;;
36 dir-645)
37 status_led="d-link:green:wps"
38 ;;
39 dap-1350)
40 status_led="d-link:blue:power"
41 ;;
42 esr-9753)
43 status_led="esr-9753:orange:power"
44 ;;
45 f5d8235-v2)
46 status_led="f5d8235v2:blue:router"
47 ;;
48 fonera20n)
49 status_led="fonera20n:green:power"
50 ;;
51 ip2202)
52 status_led="ip2202:green:run"
53 ;;
54 rt-n13u)
55 status_led="rt-n13u:power"
56 ;;
57 hlk-rm04)
58 status_led="hlk-rm04:red:power"
59 ;;
60 all0239-3g|\
61 hw550-3g)
62 status_led="hw550-3g:green:status"
63 ;;
64 m3)
65 status_led="m3:blue:status"
66 ;;
67 m4)
68 status_led="m4:blue:status"
69 ;;
70 mofi3500-3gn)
71 status_led="mofi3500-3gn:green:status"
72 ;;
73 mpr-a1)
74 status_led="mpr-a1:red:power"
75 ;;
76 mpr-a2)
77 status_led="mpr-a2:red:power"
78 ;;
79 nbg-419n)
80 status_led="nbg-419n:green:power"
81 ;;
82 nw718)
83 status_led="nw718:amber:cpu"
84 ;;
85 omni-emb|\
86 omni-emb-hpm)
87 status_led="emb:green:status"
88 ;;
89 psr-680w)
90 status_led="psr-680w:red:wan"
91 ;;
92 pwh2004)
93 status_led="pwh2004:green:power"
94 ;;
95 rt-n15)
96 status_led="rt-n15:blue:power"
97 ;;
98 rt-n10-plus)
99 status_led="asus:green:wps"
100 ;;
101 rt-n56u | wl-330n | wl-330n3g)
102 status_led="asus:blue:power"
103 ;;
104 sl-r7205)
105 status_led="sl-r7205:green:status"
106 ;;
107 tew-691gr|\
108 tew-692gr)
109 status_led="trendnet:green:wps"
110 ;;
111 v11st-fe)
112 status_led="v11st-fe:green:status"
113 ;;
114 v22rw-2x2)
115 status_led="v22rw-2x2:green:security"
116 ;;
117 w306r-v20)
118 status_led="w306r-v20:green:sys"
119 ;;
120 w502u)
121 status_led="alfa:blue:wps"
122 ;;
123 wcr-150gn)
124 status_led="wcr150gn:amber:power"
125 ;;
126 whr-g300n)
127 status_led="whr-g300n:green:router"
128 ;;
129 wmr300 | \
130 whr-300hp2 | \
131 whr-600d)
132 status_led="buffalo:green:status"
133 ;;
134 wli-tx4-ag300n)
135 status_led="buffalo:blue:power"
136 ;;
137 wl-351)
138 status_led="wl-351:amber:power"
139 ;;
140 wr512-3gn)
141 status_led="wr512:green:wps"
142 ;;
143 wnce2001)
144 status_led="netgear:green:power"
145 ;;
146 mzk-w300nh2)
147 status_led="mzkw300nh2:green:power"
148 ;;
149 ur-326n4g)
150 status_led="ur326:green:wps"
151 ;;
152 ur-336un)
153 status_led="ur336:green:wps"
154 ;;
155 x5)
156 status_led="x5:green:power"
157 ;;
158 x8)
159 status_led="x8:green:power"
160 ;;
161 xdxrn502j)
162 status_led="xdxrn502j:green:power"
163 ;;
164 f7c027)
165 status_led="belkin:orange:status"
166 ;;
167 na930)
168 status_led="na930:blue:power"
169 ;;
170 esac
171 }
172
173 set_state() {
174 get_status_led
175
176 case "$1" in
177 preinit)
178 status_led_blink_preinit
179 ;;
180 failsafe)
181 status_led_blink_failsafe
182 ;;
183 done)
184 status_led_on
185 ;;
186 esac
187 }