aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/lantiq/base-files/etc/diag.sh
diff options
context:
space:
mode:
authorJames <>2015-11-04 11:49:21 +0000
committerJames <>2015-11-04 11:49:21 +0000
commit716ca530e1c4515d8683c9d5be3d56b301758b66 (patch)
tree700eb5bcc1a462a5f21dcec15ce7c97ecfefa772 /target/linux/lantiq/base-files/etc/diag.sh
downloadtrunk-47381-716ca530e1c4515d8683c9d5be3d56b301758b66.tar.gz
trunk-47381-716ca530e1c4515d8683c9d5be3d56b301758b66.tar.bz2
trunk-47381-716ca530e1c4515d8683c9d5be3d56b301758b66.zip
trunk-47381HEADmaster
Diffstat (limited to 'target/linux/lantiq/base-files/etc/diag.sh')
-rw-r--r--target/linux/lantiq/base-files/etc/diag.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh
new file mode 100644
index 0000000..26f0a3c
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/diag.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Copyright (C) 2012-2013 OpenWrt.org
+
+. /lib/functions/leds.sh
+
+status_led="power"
+
+set_state() {
+ [ -d /sys/class/leds/power2/ ] && {
+
+ case "$1" in
+ preinit)
+ led_set_attr "power2" "trigger" "heartbeat"
+ status_led_on
+ ;;
+ failsafe)
+ led_off "power2"
+ status_led_set_timer 100 100
+ ;;
+ done)
+ led_off "power2"
+ ;;
+ esac
+ return
+ }
+
+ case "$1" in
+ preinit)
+ status_led_set_heartbeat
+ ;;
+ failsafe)
+ [ -d /sys/class/leds/power1 ] && {
+ status_led_off
+ led_timer "power1" 100 100
+ } || status_led_set_timer 100 100
+ ;;
+ done)
+ status_led_on
+ led_off "power1"
+ ;;
+ esac
+}