diag.sh 2.2 KB

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