diag.sh 612 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # Copyright (C) 2014 OpenWrt.org
  3. . /lib/functions/leds.sh
  4. . /lib/kirkwood.sh
  5. get_status_led() {
  6. case $(kirkwood_board_name) in
  7. dockstar|\
  8. goflexhome|\
  9. goflexnet)
  10. status_led="status:orange:fault"
  11. ;;
  12. pogo_e02)
  13. status_led="pogo_e02:orange:fault"
  14. ;;
  15. linksys-audi)
  16. status_led="audi:green:power"
  17. ;;
  18. linksys-viper)
  19. status_led="viper:white:health"
  20. ;;
  21. esac
  22. }
  23. set_state() {
  24. get_status_led
  25. case "$1" in
  26. preinit)
  27. status_led_blink_preinit
  28. ;;
  29. failsafe)
  30. status_led_blink_failsafe
  31. ;;
  32. preinit_regular)
  33. status_led_blink_preinit_regular
  34. ;;
  35. done)
  36. status_led_on
  37. ;;
  38. esac
  39. }