diag.sh 634 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/sh
  2. # Copyright (C) 2010-2015 OpenWrt.org
  3. . /lib/functions/leds.sh
  4. . /lib/functions/lantiq.sh
  5. boot="$(lantiq_get_dt_led boot)"
  6. failsafe="$(lantiq_get_dt_led failsafe)"
  7. running="$(lantiq_get_dt_led running)"
  8. set_state() {
  9. status_led="$boot"
  10. case "$1" in
  11. preinit)
  12. status_led_blink_preinit
  13. ;;
  14. failsafe)
  15. status_led_off
  16. [ -n "$running" ] && {
  17. status_led="$running"
  18. status_led_off
  19. }
  20. status_led="$failsafe"
  21. status_led_blink_failsafe
  22. ;;
  23. preinit_regular)
  24. status_led_blink_preinit_regular
  25. ;;
  26. done)
  27. status_led_off
  28. [ -n "$running" ] && {
  29. status_led="$running"
  30. status_led_on
  31. }
  32. ;;
  33. esac
  34. }