summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2013-02-18 10:37:52 +0000
committerFlorian Fainelli <florian@openwrt.org>2013-02-18 10:37:52 +0000
commit5953e798882e2c818ef373341a7a51545579ec1e (patch)
treeedff93d10e351db7afb20c016a4046524969dca8
parent15b66e0cbe4c99f453780b8b8fbf21e5e174bb1e (diff)
downloadmtk-20170518-5953e798882e2c818ef373341a7a51545579ec1e.zip
mtk-20170518-5953e798882e2c818ef373341a7a51545579ec1e.tar.gz
mtk-20170518-5953e798882e2c818ef373341a7a51545579ec1e.tar.bz2
au1000: migrate to common led helper functions
Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 35660
-rw-r--r--target/linux/au1000/base-files/etc/diag.sh26
1 files changed, 11 insertions, 15 deletions
diff --git a/target/linux/au1000/base-files/etc/diag.sh b/target/linux/au1000/base-files/etc/diag.sh
index d974615..65e3011 100644
--- a/target/linux/au1000/base-files/etc/diag.sh
+++ b/target/linux/au1000/base-files/etc/diag.sh
@@ -1,25 +1,21 @@
#!/bin/sh
-# Copyright (C) 2007 OpenWrt.org
+# Copyright (C) 2007-2013 OpenWrt.org
-set_led() {
- local led="$1"
- local state="$2"
- [ -d "/sys/class/leds/mtx1:$led" ] && echo "$state" > "/sys/class/leds/mtx1:$led/brightness"
-}
+. /lib/functions/leds.sh
set_state() {
case "$1" in
- preinit)
- set_led green 0
- set_led red 1
+ preinit)
+ led_off "mtx1:green"
+ led_on "mtx1:red"
;;
- failsafe)
- set_led green 1
- set_led red 1
+ failsafe)
+ led_on "mtx1:green"
+ led_on "mtx1:red"
;;
- done)
- set_led green 1
- set_led red 0
+ done)
+ led_on "mtx1:green"
+ led_off "mtx1:red"
;;
esac
}