diff options
Diffstat (limited to 'target/linux/ath79/base-files/etc/diag.sh')
-rwxr-xr-x[-rw-r--r--] | target/linux/ath79/base-files/etc/diag.sh | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/target/linux/ath79/base-files/etc/diag.sh b/target/linux/ath79/base-files/etc/diag.sh index 5a21006528..a3a7047702 100644..100755 --- a/target/linux/ath79/base-files/etc/diag.sh +++ b/target/linux/ath79/base-files/etc/diag.sh @@ -2,21 +2,46 @@ . /lib/functions/leds.sh -status_led="$(get_dt_led status)" +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" +upgrade="$(get_dt_led upgrade)" + +get_status_led() { + status_led="$boot" +} set_state() { + status_led="$boot" + case "$1" in preinit) status_led_blink_preinit ;; failsafe) + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_off + } + status_led="$failsafe" status_led_blink_failsafe ;; preinit_regular) status_led_blink_preinit_regular ;; + upgrade) + [ -n "$running" ] && { + status_led="$upgrade" + status_led_blink_preinit_regular + } + ;; done) - status_led_on + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_on + } ;; esac } |