gre: Support fqdn as remote tunnel endpoint
[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 board=$(ramips_board_name)
9
10 case $board in
11 3g150b|\
12 3g300m|\
13 w150m)
14 status_led="$board:blue:ap"
15 ;;
16 3g-6200n|\
17 ar670w|\
18 ar725w|\
19 asl26555|\
20 br-6425|\
21 br-6475nd|\
22 dch-m225|\
23 dir-860l-b1|\
24 e1700|\
25 fonera20n|\
26 mzk-750dhp|\
27 mzk-dp150n|\
28 mzk-w300nh2|\
29 nbg-419n|\
30 pwh2004|\
31 wnce2001|\
32 wndr3700v5|\
33 x5|\
34 x8|\
35 xdxrn502j)
36 status_led="$board:green:power"
37 ;;
38 a5-v11|\
39 cs-qr10|\
40 d105|\
41 dcs-930l-b1|\
42 ex2700|\
43 hlk-rm04|\
44 jhr-n825r|\
45 mpr-a1|\
46 mpr-a2|\
47 mzk-ex750np)
48 status_led="$board:red:power"
49 ;;
50 ai-br100|\
51 ht-tm02)
52 status_led="$board:blue:wlan"
53 ;;
54 all0239-3g|\
55 dcs-930|\
56 dir-300-b1|\
57 dir-300-b7|\
58 dir-320-b1|\
59 dir-600-b1|\
60 dir-600-b2|\
61 dir-610-a1|\
62 dir-615-d|\
63 dir-615-h1|\
64 dir-620-a1|\
65 dir-620-d1|\
66 hpm|\
67 hw550-3g|\
68 mac1200rv2|\
69 miniembwifi|\
70 mofi3500-3gn|\
71 rut5xx|\
72 v11st-fe|\
73 vocore|\
74 wmr-300|\
75 zbt-wg2626|\
76 zbt-wg3526)
77 status_led="$board:green:status"
78 ;;
79 atp-52b|\
80 ip2202)
81 status_led="$board:green:run"
82 ;;
83 awapn2403|\
84 dir-645|\
85 sk-wb8|\
86 wrh-300cr)
87 status_led="$board:green:wps"
88 ;;
89 c50)
90 status_led="tp-link:blue:power"
91 ;;
92 cf-wr800n|\
93 psg1208)
94 status_led="$board:white:wps"
95 ;;
96 psg1218)
97 status_led="$board:blue:status"
98 ;;
99 cy-swr1100|\
100 w502u)
101 status_led="$board:blue:wps"
102 ;;
103 dap-1350|\
104 na930|\
105 pbr-m1|\
106 rt-n13u|\
107 rt-n14u|\
108 rt-n15|\
109 rt-n56u|\
110 wl-330n|\
111 wl-330n3g|\
112 wli-tx4-ag300n|\
113 wt3020|\
114 y1|\
115 y1s)
116 status_led="$board:blue:power"
117 ;;
118 db-wrt01|\
119 esr-9753|\
120 pbr-d1)
121 status_led="$board:orange:power"
122 ;;
123 f5d8235-v2)
124 status_led="$board:blue:router"
125 ;;
126 f7c027|\
127 timecloud)
128 status_led="$board:orange:status"
129 ;;
130 hc5*61|\
131 jhr-n805r|\
132 jhr-n926r|\
133 mlw221|\
134 mlwg2)
135 status_led="$board:blue:system"
136 ;;
137 linkits7688| \
138 linkits7688d)
139 [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
140 ;;
141 m2m)
142 status_led="$board:blue:wifi"
143 ;;
144 m3|\
145 m4)
146 status_led="$board:blue:status"
147 ;;
148 miwifi-mini|\
149 miwifi-nano|\
150 zte-q7)
151 status_led="$board:red:status"
152 ;;
153 mr-102n)
154 status_led="$board:amber:status"
155 ;;
156 nw718)
157 status_led="$board:amber:cpu"
158 ;;
159 newifi-d1)
160 status_led="$board:blue:status"
161 ;;
162 oy-0001|\
163 sl-r7205|\
164 zbt-we826)
165 status_led="$board:green:wifi"
166 ;;
167 psr-680w)
168 status_led="$board:red:wan"
169 ;;
170 px-4885|\
171 re6500|\
172 whr-1166d|\
173 whr-300hp2|\
174 whr-600d|\
175 widora-neo)
176 status_led="$board:orange:wifi"
177 ;;
178 mzk-ex300np|\
179 rt-n10-plus|\
180 tew-691gr|\
181 tew-692gr|\
182 ur-326n4g|\
183 ur-336un|\
184 wf-2881|\
185 wr512-3gn)
186 status_led="$board:green:wps"
187 ;;
188 sap-g3200u3)
189 status_led="$board:green:usb"
190 ;;
191 v22rw-2x2)
192 status_led="$board:green:security"
193 ;;
194 w306r-v20|\
195 witi|\
196 zbt-wr8305rt)
197 status_led="$board:green:sys"
198 ;;
199 wcr-150gn|\
200 wl-351)
201 status_led="$board:amber:power"
202 ;;
203 whr-g300n|\
204 wzr-agl300nh)
205 status_led="$board:green:router"
206 ;;
207 wizfi630a)
208 status_led="$board::run"
209 ;;
210 wsr-1166|\
211 wsr-600)
212 status_led="$board:green:power"
213 ;;
214 wrtnode2r | \
215 wrtnode2p | \
216 wrtnode)
217 status_led="wrtnode:blue:indicator"
218 ;;
219 zbt-cpe102)
220 status_led="$board:green:4g-0"
221 ;;
222 esac
223 }
224
225 set_state() {
226 get_status_led $1
227
228 case "$1" in
229 preinit)
230 status_led_blink_preinit
231 ;;
232 failsafe)
233 status_led_blink_failsafe
234 ;;
235 upgrade | \
236 preinit_regular)
237 status_led_blink_preinit_regular
238 ;;
239 done)
240 status_led_on
241 ;;
242 esac
243 }