diag.sh 739 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/sh
  2. # Copyright (C) 2014-2016 OpenWrt.org
  3. # Copyright (C) 2016 LEDE-Project.org
  4. . /lib/functions/leds.sh
  5. . /lib/mvebu.sh
  6. get_status_led() {
  7. case $(mvebu_board_name) in
  8. armada-385-linksys-caiman)
  9. status_led="caiman:white:power"
  10. ;;
  11. armada-385-linksys-cobra)
  12. status_led="cobra:white:power"
  13. ;;
  14. armada-385-linksys-rango)
  15. status_led="rango:white:power"
  16. ;;
  17. armada-385-linksys-shelby)
  18. status_led="shelby:white:power"
  19. ;;
  20. armada-xp-linksys-mamba)
  21. status_led="mamba:white:power"
  22. ;;
  23. esac
  24. }
  25. set_state() {
  26. get_status_led
  27. case "$1" in
  28. preinit)
  29. status_led_blink_preinit
  30. ;;
  31. failsafe)
  32. status_led_blink_failsafe
  33. ;;
  34. preinit_regular)
  35. status_led_blink_preinit_regular
  36. ;;
  37. done)
  38. status_led_on
  39. ;;
  40. esac
  41. }