diag.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #!/bin/sh
  2. # Copyright (C) 2007-2013 OpenWrt.org
  3. . /lib/functions/leds.sh
  4. . /lib/brcm63xx.sh
  5. set_state() {
  6. case "$(brcm63xx_board_name)" in
  7. a4001n1)
  8. status_led="A4001N1:green:power"
  9. ;;
  10. a4001n)
  11. status_led="A4001N:green:power"
  12. ;;
  13. ar-5381u)
  14. status_led="AR-5381u:green:power"
  15. ;;
  16. ar-5387un)
  17. status_led="AR-5387un:green:power"
  18. ;;
  19. bcm96348gw)
  20. status_led="96348GW:green:power"
  21. ;;
  22. bcm963281tan)
  23. status_led="963281TAN::power"
  24. ;;
  25. bcm96328avng)
  26. status_led="96328avng::power"
  27. ;;
  28. bcm96348gw-11)
  29. status_led="96348GW-11:green:power"
  30. ;;
  31. spw303v)
  32. status_led="spw303v:green:power+adsl"
  33. ;;
  34. vh4032n)
  35. status_led="VH4032N:red:power"
  36. ;;
  37. vr-3025un)
  38. status_led="VR-3025un:green:power"
  39. ;;
  40. vr-3025u)
  41. status_led="VR-3025u:green:power"
  42. ;;
  43. vr-3026e)
  44. status_led="VR-3026e:green:power"
  45. ;;
  46. wap-5813n)
  47. status_led="WAP-5813n:green:power"
  48. ;;
  49. ar1004g)
  50. status_led="AR1004G:green:power"
  51. ;;
  52. dsl-274xb-c|\
  53. dsl-274xb-f)
  54. status_led="dsl-274xb:green:power"
  55. ;;
  56. dsl-275xb-d)
  57. status_led="dsl-275xb:green:power"
  58. ;;
  59. cpva642)
  60. status_led="CPVA642:green:power:"
  61. ;;
  62. ct-536p_5621t)
  63. status_led="CT536_CT5621:green:power"
  64. ;;
  65. cvg834g)
  66. status_led="CVG834G:green:power"
  67. ;;
  68. dsl-2640b-b)
  69. status_led="D-4P-W:green:power"
  70. ;;
  71. dgnd3700v1_dgnd3800b)
  72. status_led="DGND3700v1_3800B:green:power"
  73. ;;
  74. evg2000)
  75. status_led="EVG2000:green:power"
  76. ;;
  77. fast2504n)
  78. status_led="fast2504n:green:ok"
  79. ;;
  80. fast2704n)
  81. status_led2="F@ST2704N:red:power"
  82. ;;
  83. fast2704v2)
  84. status_led="F@ST2704V2:green:power"
  85. ;;
  86. homehub2a)
  87. status_led="HOMEHUB2A:green:upgrading"
  88. status_led2="HOMEHUB2A:blue:upgrading"
  89. ;;
  90. gw6200)
  91. status_led="GW6200:green:line1"
  92. status_led2="GW6200:green:tel"
  93. ;;
  94. hg553)
  95. status_led="HW553:blue:power"
  96. ;;
  97. hg556a_*)
  98. status_led="HW556:red:power"
  99. ;;
  100. hg520)
  101. status_led="HW520:green:net"
  102. ;;
  103. hg655b)
  104. status_led="HW65x:green:power"
  105. ;;
  106. livebox1)
  107. status_led="Livebox1:red:adsl-fail-power"
  108. ;;
  109. p870hw-51a_v2)
  110. status_led="P870HW-51a:green:power"
  111. ;;
  112. r5010un_v2)
  113. status_led="R5010UNv2:green:power"
  114. ;;
  115. rta770bw)
  116. status_led="RTA770BW:green:diag"
  117. ;;
  118. rta770w)
  119. status_led="RTA770W:green:diag"
  120. ;;
  121. spw500v)
  122. status_led="SPW500V:green:power"
  123. ;;
  124. v2110)
  125. status_led="V2110:power:green"
  126. ;;
  127. esac
  128. case "$1" in
  129. preinit)
  130. status_led_set_timer 200 200
  131. ;;
  132. failsafe)
  133. status_led_set_timer 50 50
  134. ;;
  135. preinit_regular)
  136. status_led_set_timer 500 500
  137. ;;
  138. done)
  139. if [ "${status_led/power}" != "$status_led" ]; then
  140. status_led_on
  141. else
  142. status_led_off
  143. fi
  144. ;;
  145. esac
  146. }