diff options
author | Florian Fainelli <florian@openwrt.org> | 2013-02-18 10:37:52 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2013-02-18 10:37:52 +0000 |
commit | 3b1a2e5c15e66fabbbc4f6e9b23650f7bd8aa29b (patch) | |
tree | e0b63a93661d09f7f8faecb4a0bedceda1b95d7c /target/linux/au1000/base-files | |
parent | 2afebad8bb74454af5f9b8d1e46eef9bf76b4dde (diff) | |
download | master-187ad058-3b1a2e5c15e66fabbbc4f6e9b23650f7bd8aa29b.tar.gz master-187ad058-3b1a2e5c15e66fabbbc4f6e9b23650f7bd8aa29b.tar.bz2 master-187ad058-3b1a2e5c15e66fabbbc4f6e9b23650f7bd8aa29b.zip |
au1000: migrate to common led helper functions
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
Signed-off-by: Florian Fainelli <florian@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35660 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/au1000/base-files')
-rw-r--r-- | target/linux/au1000/base-files/etc/diag.sh | 26 |
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 d97461532a..65e3011be5 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 } |