diag.sh 548 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Copyright (C) 2013-2014 OpenWrt.org
  3. . /lib/functions/leds.sh
  4. . /lib/mxs.sh
  5. get_status_led() {
  6. case $(mxs_board_name) in
  7. duckbill)
  8. status_led="duckbill:green:status"
  9. ;;
  10. olinuxino)
  11. status_led="green"
  12. ;;
  13. *)
  14. status_led=$(cd /sys/class/leds && ls -1d *:status 2> /dev/null | head -n 1)
  15. ;;
  16. esac
  17. }
  18. set_state() {
  19. get_status_led
  20. case "$1" in
  21. preinit)
  22. status_led_blink_preinit
  23. ;;
  24. failsafe)
  25. status_led_blink_failsafe
  26. ;;
  27. preinit_regular)
  28. status_led_blink_preinit_regular
  29. ;;
  30. done)
  31. status_led_on
  32. ;;
  33. esac
  34. }