diag.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. gb-pc1|\
  72. hpm|\
  73. hw550-3g|\
  74. mac1200rv2|\
  75. miniembwifi|\
  76. mofi3500-3gn|\
  77. rut5xx|\
  78. v11st-fe|\
  79. vocore|\
  80. wmr-300|\
  81. zbt-wg2626|\
  82. zbt-wg3526)
  83. status_led="$board:green:status"
  84. ;;
  85. ai-br100|\
  86. ht-tm02)
  87. status_led="$board:blue:wlan"
  88. ;;
  89. atp-52b|\
  90. ip2202)
  91. status_led="$board:green:run"
  92. ;;
  93. awapn2403|\
  94. dir-645|\
  95. sk-wb8|\
  96. wrh-300cr)
  97. status_led="$board:green:wps"
  98. ;;
  99. cf-wr800n|\
  100. psg1208)
  101. status_led="$board:white:wps"
  102. ;;
  103. psg1218)
  104. status_led="$board:yellow:status"
  105. ;;
  106. cy-swr1100|\
  107. w502u)
  108. status_led="$board:blue:wps"
  109. ;;
  110. d240|\
  111. dap-1350|\
  112. na930|\
  113. pbr-m1|\
  114. rt-n13u|\
  115. rt-n14u|\
  116. rt-n15|\
  117. rt-n56u|\
  118. wl-330n|\
  119. wl-330n3g|\
  120. wli-tx4-ag300n|\
  121. wt3020|\
  122. y1|\
  123. y1s)
  124. status_led="$board:blue:power"
  125. ;;
  126. db-wrt01|\
  127. esr-9753|\
  128. pbr-d1)
  129. status_led="$board:orange:power"
  130. ;;
  131. f5d8235-v1)
  132. status_led="$board:blue:wired"
  133. ;;
  134. f5d8235-v2)
  135. status_led="$board:blue:router"
  136. ;;
  137. f7c027|\
  138. timecloud)
  139. status_led="$board:orange:status"
  140. ;;
  141. hc5*61|\
  142. jhr-n805r|\
  143. jhr-n926r|\
  144. mlw221|\
  145. mlwg2)
  146. status_led="$board:blue:system"
  147. ;;
  148. linkits7688| \
  149. linkits7688d)
  150. [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
  151. ;;
  152. m2m)
  153. status_led="$board:blue:wifi"
  154. ;;
  155. m3|\
  156. m4|\
  157. miwifi-nano)
  158. status_led="$board:blue:status"
  159. ;;
  160. miwifi-mini|\
  161. zte-q7)
  162. status_led="$board:red:status"
  163. ;;
  164. mr-102n)
  165. status_led="$board:amber:status"
  166. ;;
  167. mr200)
  168. status_led="$board:white:power"
  169. ;;
  170. nw718)
  171. status_led="$board:amber:cpu"
  172. ;;
  173. newifi-d1)
  174. status_led="$board:blue:status"
  175. ;;
  176. omega2| \
  177. omega2p)
  178. status_led="$board:amber:system"
  179. ;;
  180. oy-0001|\
  181. sl-r7205|\
  182. zbt-we826)
  183. status_led="$board:green:wifi"
  184. ;;
  185. psr-680w)
  186. status_led="$board:red:wan"
  187. ;;
  188. px-4885|\
  189. re6500|\
  190. whr-1166d|\
  191. whr-600d|\
  192. widora-neo)
  193. status_led="$board:orange:wifi"
  194. ;;
  195. mzk-ex300np|\
  196. rt-n10-plus|\
  197. tew-691gr|\
  198. tew-692gr|\
  199. ur-326n4g|\
  200. ur-336un|\
  201. wf-2881|\
  202. wr512-3gn)
  203. status_led="$board:green:wps"
  204. ;;
  205. rb750gr3)
  206. status_led="$board:blue:pwr"
  207. ;;
  208. sap-g3200u3)
  209. status_led="$board:green:usb"
  210. ;;
  211. v22rw-2x2)
  212. status_led="$board:green:security"
  213. ;;
  214. vocore2)
  215. status_led="$board:fuchsia:status"
  216. ;;
  217. w306r-v20|\
  218. witi|\
  219. zbt-wr8305rt)
  220. status_led="$board:green:sys"
  221. ;;
  222. wcr-150gn|\
  223. wl-351)
  224. status_led="$board:amber:power"
  225. ;;
  226. whr-g300n|\
  227. wlr-6000)
  228. status_led="$board:red:power"
  229. ;;
  230. wzr-agl300nh)
  231. status_led="$board:green:router"
  232. ;;
  233. wizfi630a)
  234. status_led="$board::run"
  235. ;;
  236. whr-300hp2|\
  237. wsr-1166|\
  238. wsr-600)
  239. status_led="$board:green:power"
  240. ;;
  241. wrtnode2r | \
  242. wrtnode2p | \
  243. wrtnode)
  244. status_led="wrtnode:blue:indicator"
  245. ;;
  246. zbt-cpe102)
  247. status_led="$board:green:4g-0"
  248. ;;
  249. esac
  250. }
  251. set_state() {
  252. get_status_led $1
  253. case "$1" in
  254. preinit)
  255. status_led_blink_preinit
  256. ;;
  257. failsafe)
  258. status_led_blink_failsafe
  259. ;;
  260. upgrade | \
  261. preinit_regular)
  262. status_led_blink_preinit_regular
  263. ;;
  264. done)
  265. status_led_on
  266. ;;
  267. esac
  268. }