aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/base-files/etc/diag.sh
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/ramips/base-files/etc/diag.sh')
-rw-r--r--target/linux/ramips/base-files/etc/diag.sh29
1 files changed, 25 insertions, 4 deletions
diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh
index d4318b61a7..3ea7ac1a1d 100644
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -1,24 +1,45 @@
#!/bin/sh
-# Copyright (C) 2010-2013 OpenWrt.org
. /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)"
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
;;
- upgrade | \
preinit_regular)
status_led_blink_preinit_regular
;;
+ upgrade)
+ [ -n "$running" ] && {
+ status_led="$running"
+ status_led_off
+ }
+ status_led="$upgrade"
+ status_led_blink_preinit_regular
+ ;;
done)
- status_led_on
+ status_led_off
+ [ -n "$running" ] && {
+ status_led="$running"
+ status_led_on
+ }
;;
esac
}