2
0

diag.sh 3.6 KB

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