diag.sh 3.8 KB

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