X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/25156f20f7b1781c47ef4fff74586680baed4b85..b7d3d9d3cef2286b7266dc447265a0a21565b9b9:/package/base-files/files/etc/init.d/led diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 4a02f3d30..e4e812d7a 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 + } } }