diag.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. vr-3025un)
  35. status_led="VR-3025un:green:power"
  36. ;;
  37. vr-3025u)
  38. status_led="VR-3025u:green:power"
  39. ;;
  40. vr-3026e)
  41. status_led="VR-3026e:green:power"
  42. ;;
  43. wap-5813n)
  44. status_led="WAP-5813n:green:power"
  45. ;;
  46. ar1004g)
  47. status_led="AR1004G:green:power"
  48. ;;
  49. dsl-274xb-c|\
  50. dsl-274xb-f)
  51. status_led="dsl-274xb:green:power"
  52. ;;
  53. dsl-275xb-d)
  54. status_led="dsl-275xb:green:power"
  55. ;;
  56. cpva642)
  57. status_led="CPVA642:green:power:"
  58. ;;
  59. ct-536p_5621t)
  60. status_led="CT536_CT5621:green:power"
  61. ;;
  62. cvg834g)
  63. status_led="CVG834G:green:power"
  64. ;;
  65. dsl-2640b-b)
  66. status_led="D-4P-W:green:power"
  67. ;;
  68. dgnd3700v1_dgnd3800b)
  69. status_led="DGND3700v1_3800B:green:power"
  70. ;;
  71. evg2000)
  72. status_led="EVG2000:green:power"
  73. ;;
  74. fast2504n)
  75. status_led="fast2504n:green:ok"
  76. ;;
  77. fast2704n)
  78. status_led2="F@ST2704N:red:power"
  79. ;;
  80. fast2704v2)
  81. status_led="F@ST2704V2:green:power"
  82. ;;
  83. homehub2a)
  84. status_led="HOMEHUB2A:green:upgrading"
  85. status_led2="HOMEHUB2A:blue:upgrading"
  86. ;;
  87. gw6200)
  88. status_led="GW6200:green:line1"
  89. status_led2="GW6200:green:tel"
  90. ;;
  91. hg553)
  92. status_led="HW553:blue:power"
  93. ;;
  94. hg556a_*)
  95. status_led="HW556:red:power"
  96. ;;
  97. hg520)
  98. status_led="HW520:green:net"
  99. ;;
  100. hg655b)
  101. status_led="HW65x:green:power"
  102. ;;
  103. p870hw-51a_v2)
  104. status_led="P870HW-51a:green:power"
  105. ;;
  106. r5010un_v2)
  107. status_led="R5010UNv2:green:power"
  108. ;;
  109. rta770bw)
  110. status_led="RTA770BW:green:diag"
  111. ;;
  112. rta770w)
  113. status_led="RTA770W:green:diag"
  114. ;;
  115. spw500v)
  116. status_led="SPW500V:green:power"
  117. ;;
  118. v2110)
  119. status_led="V2110:power:green"
  120. ;;
  121. esac
  122. case "$1" in
  123. preinit)
  124. status_led_set_timer 200 200
  125. ;;
  126. failsafe)
  127. status_led_set_timer 50 50
  128. ;;
  129. preinit_regular)
  130. status_led_set_timer 500 500
  131. ;;
  132. done)
  133. if [ "${status_led/power}" != "$status_led" ]; then
  134. status_led_on
  135. else
  136. status_led_off
  137. fi
  138. ;;
  139. esac
  140. }