aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2011-01-27 21:49:46 +0000
committerFlorian Fainelli <florian@openwrt.org>2011-01-27 21:49:46 +0000
commitedb55f44e8797817142102ec61eb8cbd1dddb8c6 (patch)
tree27058a73942a0291dff0c6f54744133ac4b9b5fa /package/base-files/files
parentbcc1c50eb99b12954d39de08452b597e0b400a38 (diff)
downloadupstream-edb55f44e8797817142102ec61eb8cbd1dddb8c6.tar.gz
upstream-edb55f44e8797817142102ec61eb8cbd1dddb8c6.tar.bz2
upstream-edb55f44e8797817142102ec61eb8cbd1dddb8c6.zip
[package] base-files: support port_state in led config (#6763)
Signed-off-by: Alexey Torkhov <atorkhov@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25172 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/etc/init.d/led4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index 4a02f3d306..e4e812d7ad 100755
--- a/package/base-files/files/etc/init.d/led
+++ b/package/base-files/files/etc/init.d/led
@@ -23,6 +23,7 @@ load_led() {
config_get delayon $1 delayon
config_get delayoff $1 delayoff
config_get interval $1 interval "50"
+ config_get port_state $1 port_state
[ -e /sys/class/leds/${sysfs}/brightness ] && {
echo "setting up led ${name}"
@@ -45,6 +46,9 @@ load_led() {
echo $dev > /sys/class/leds/${sysfs}/device_name
echo $interval > /sys/class/leds/${sysfs}/activity_interval
}
+ [ "$trigger" == "port_state" -a -n "$port_state" ] && {
+ echo $port_state > /sys/class/leds/${sysfs}/port_state
+ }
}
}