From d7fe921089b270c2fa7ab790ce2100177a313fed Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Thu, 27 Jan 2011 21:49:46 +0000 Subject: [PATCH] base-files: support port_state in led config (#6763) Signed-off-by: Alexey Torkhov SVN-Revision: 25172 --- package/base-files/files/etc/init.d/led | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 4a02f3d3064..e4e812d7adf 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 + } } }