diag.sh 448 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/sh
  2. . /lib/functions/leds.sh
  3. . /lib/apm821xx.sh
  4. get_status_led() {
  5. local board=$(apm821xx_board_name)
  6. case $board in
  7. mbl|\
  8. mr24|\
  9. mx60|\
  10. wndr4700)
  11. status_led="$board:green:power"
  12. ;;
  13. *)
  14. ;;
  15. esac
  16. }
  17. set_state() {
  18. get_status_led
  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. }