diag.sh 583 B

12345678910111213141516171819202122232425262728293031323334
  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_chosen boot)"
  6. failsafe="$(lantiq_get_dt_led_chosen failsafe)"
  7. running="$(lantiq_get_dt_led_chosen 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. status_led="$failsafe"
  17. status_led_blink_failsafe
  18. ;;
  19. preinit_regular)
  20. status_led_blink_preinit_regular
  21. ;;
  22. done)
  23. status_led_off
  24. [ -n "$running" ] && {
  25. status_led="$running"
  26. status_led_on
  27. }
  28. ;;
  29. esac
  30. }