Signed-off-by: Michael Heimpold <mhei@heimpold.de> Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 35660master
parent
15b66e0cbe
commit
5953e79888
@ -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 |
||||
led_off "mtx1:green" |
||||
led_on "mtx1:red" |
||||
;; |
||||
failsafe) |
||||
set_led green 1 |
||||
set_led red 1 |
||||
led_on "mtx1:green" |
||||
led_on "mtx1:red" |
||||
;; |
||||
done) |
||||
set_led green 1 |
||||
set_led red 0 |
||||
led_on "mtx1:green" |
||||
led_off "mtx1:red" |
||||
;; |
||||
esac |
||||
} |
||||
|
Loading…
Reference in new issue