diag.sh 4.6 KB

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