diag.sh 499 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # Copyright (C) 2015-2016 OpenWrt.org
  3. # Copyright (C) 2017 LEDE project
  4. . /lib/functions/leds.sh
  5. . /lib/brcm2708.sh
  6. set_state() {
  7. case "$(brcm2708_board_name)" in
  8. rpi-2-b |\
  9. rpi-b-plus)
  10. status_led="led1"
  11. ;;
  12. rpi-b |\
  13. rpi-cm |\
  14. rpi-zero |\
  15. rpi-zero-w)
  16. status_led="led0"
  17. ;;
  18. esac
  19. case "$1" in
  20. preinit)
  21. status_led_blink_preinit
  22. ;;
  23. failsafe)
  24. status_led_blink_failsafe
  25. ;;
  26. preinit_regular)
  27. status_led_blink_preinit_regular
  28. ;;
  29. done)
  30. status_led_on
  31. ;;
  32. esac
  33. }