ipq806x: add diag.sh script
authorSigned-off-by: Henryk Heisig <hyniu@o2.pl>
Fri, 3 Jun 2016 09:51:28 +0000 (11:51 +0200)
committerJohn Crispin <john@phrozen.org>
Sun, 5 Jun 2016 21:23:57 +0000 (23:23 +0200)
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
target/linux/ipq806x/base-files/etc/diag.sh [new file with mode: 0755]

diff --git a/target/linux/ipq806x/base-files/etc/diag.sh b/target/linux/ipq806x/base-files/etc/diag.sh
new file mode 100755 (executable)
index 0000000..b19012c
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. /lib/functions/leds.sh
+. /lib/ipq806x.sh
+
+get_status_led() {
+       case $(ipq806x_board_name) in
+       c2600)
+               status_led="status:blue"
+               ;;
+       esac
+}
+
+set_state() {
+       get_status_led
+
+       case "$1" in
+       preinit)
+               status_led_blink_preinit
+               ;;
+       failsafe)
+               status_led_blink_failsafe
+               ;;
+       preinit_regular)
+               status_led_blink_preinit_regular
+               ;;
+       done)
+               status_led_on
+               ;;
+       esac
+}