summaryrefslogtreecommitdiff
path: root/target/linux/lantiq/base-files/etc/diag.sh
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2012-12-15 02:01:00 +0000
committerJohn Crispin <john@openwrt.org>2012-12-15 02:01:00 +0000
commit1dece11487e937deb4691f73545c1403d018421d (patch)
tree4a2e99f213629991d7a9520a3408028e3b42f9b3 /target/linux/lantiq/base-files/etc/diag.sh
parent601bc28669719c8ef004e108cb0bc9e5c784412e (diff)
downloadmtk-20170518-1dece11487e937deb4691f73545c1403d018421d.zip
mtk-20170518-1dece11487e937deb4691f73545c1403d018421d.tar.gz
mtk-20170518-1dece11487e937deb4691f73545c1403d018421d.tar.bz2
cleanup basefiles
SVN-Revision: 34698
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..d0088f5
--- /dev/null
+++ b/target/linux/lantiq/base-files/etc/diag.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+# Copyright (C) 2012 OpenWrt.org
+
+[ -d /sys/class/leds/power/ ] || return
+
+set_state() {
+ [ -d /sys/class/leds/power1/ ] && {
+
+ case "$1" in
+ preinit)
+ echo heartbeat >/sys/class/leds/power/trigger
+ ;;
+ failsafe)
+ echo none >/sys/class/leds/power/trigger
+ echo timer >/sys/class/leds/power1/trigger
+ echo 100 >/sys/class/leds/power1/delay_on
+ echo 100 >/sys/class/leds/power1/delay_off
+ ;;
+ done)
+ echo none >/sys/class/leds/power/trigger
+ echo none >/sys/class/leds/power1/trigger
+ echo 1 >/sys/class/leds/power/brightness
+ ;;
+ esac
+ return
+ }
+
+ case "$1" in
+ preinit)
+ echo heartbeat >/sys/class/leds/power/trigger
+ ;;
+ failsafe)
+ echo timer >/sys/class/leds/power/trigger
+ echo 100 >/sys/class/leds/power/delay_on
+ echo 100 >/sys/class/leds/power/delay_off
+ ;;
+ done)
+ echo none >/sys/class/leds/power/trigger
+ echo 1 >/sys/class/leds/power/brightness
+ ;;
+ esac
+}