diag.sh 3.2 KB

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