diag.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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. firewrt|\
  25. hg255d|\
  26. kn_rc|\
  27. kn_rf|\
  28. kng_rc|\
  29. mzk-750dhp|\
  30. mzk-dp150n|\
  31. mzk-w300nh2|\
  32. nbg-419n|\
  33. nbg-419n2|\
  34. pwh2004|\
  35. vr500|\
  36. wnce2001|\
  37. wndr3700v5|\
  38. x5|\
  39. x8|\
  40. xdxrn502j)
  41. status_led="$board:green:power"
  42. ;;
  43. 3g-6200nl)
  44. status_led="$board:green:internet"
  45. ;;
  46. a5-v11|\
  47. cs-qr10|\
  48. d105|\
  49. dcs-930l-b1|\
  50. ex2700|\
  51. hlk-rm04|\
  52. jhr-n825r|\
  53. mpr-a1|\
  54. mpr-a2|\
  55. mzk-ex750np|\
  56. wn3000rpv3)
  57. status_led="$board:red:power"
  58. ;;
  59. ac1200pro|\
  60. all0239-3g|\
  61. dcs-930|\
  62. dir-300-b1|\
  63. dir-300-b7|\
  64. dir-320-b1|\
  65. dir-600-b1|\
  66. dir-610-a1|\
  67. dir-615-d|\
  68. dir-615-h1|\
  69. dir-620-a1|\
  70. dir-620-d1|\
  71. dwr-512-b|\
  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. youku-yk1)
  125. status_led="$board:blue:power"
  126. ;;
  127. db-wrt01|\
  128. esr-9753|\
  129. pbr-d1)
  130. status_led="$board:orange:power"
  131. ;;
  132. f5d8235-v1)
  133. status_led="$board:blue:wired"
  134. ;;
  135. f5d8235-v2)
  136. status_led="$board:blue:router"
  137. ;;
  138. f7c027|\
  139. timecloud)
  140. status_led="$board:orange:status"
  141. ;;
  142. hc5*61|\
  143. jhr-n805r|\
  144. jhr-n926r|\
  145. mlw221|\
  146. mlwg2)
  147. status_led="$board:blue:system"
  148. ;;
  149. linkits7688| \
  150. linkits7688d)
  151. [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi"
  152. ;;
  153. m2m)
  154. status_led="$board:blue:wifi"
  155. ;;
  156. m3|\
  157. m4|\
  158. miwifi-nano)
  159. status_led="$board:blue:status"
  160. ;;
  161. miwifi-mini|\
  162. zte-q7)
  163. status_led="$board:red:status"
  164. ;;
  165. mr-102n)
  166. status_led="$board:amber:status"
  167. ;;
  168. mr200)
  169. status_led="$board:white:power"
  170. ;;
  171. nw718)
  172. status_led="$board:amber:cpu"
  173. ;;
  174. newifi-d1)
  175. status_led="$board:blue:status"
  176. ;;
  177. omega2| \
  178. omega2p)
  179. status_led="$board:amber:system"
  180. ;;
  181. oy-0001|\
  182. sl-r7205|\
  183. zbt-we826)
  184. status_led="$board:green:wifi"
  185. ;;
  186. psr-680w)
  187. status_led="$board:red:wan"
  188. ;;
  189. px-4885|\
  190. re6500|\
  191. whr-1166d|\
  192. whr-600d)
  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. widora-neo)
  231. status_led="widora:orange:wifi"
  232. ;;
  233. wzr-agl300nh)
  234. status_led="$board:green:router"
  235. ;;
  236. wizfi630a)
  237. status_led="$board::run"
  238. ;;
  239. whr-300hp2|\
  240. wsr-1166|\
  241. wsr-600)
  242. status_led="$board:green:power"
  243. ;;
  244. wrtnode2r | \
  245. wrtnode2p | \
  246. wrtnode)
  247. status_led="wrtnode:blue:indicator"
  248. ;;
  249. zbt-cpe102)
  250. status_led="$board:green:4g-0"
  251. ;;
  252. esac
  253. }
  254. set_state() {
  255. get_status_led $1
  256. case "$1" in
  257. preinit)
  258. status_led_blink_preinit
  259. ;;
  260. failsafe)
  261. status_led_blink_failsafe
  262. ;;
  263. upgrade | \
  264. preinit_regular)
  265. status_led_blink_preinit_regular
  266. ;;
  267. done)
  268. status_led_on
  269. ;;
  270. esac
  271. }