config_get gpio $1 gpio "0"
config_get_bool inverted $1 inverted "0"
+ [ "$2" ] && [ "$sysfs" != "$2" ] && return
+
# execute application led trigger
[ -f "/usr/libexec/led-trigger/${trigger}" ] && {
. "/usr/libexec/led-trigger/${trigger}"
[ -e "/sys/class/leds/${sysfs}/$m" ] && \
echo 1 > /sys/class/leds/${sysfs}/$m
done
- echo $interval > /sys/class/leds/${sysfs}/interval
+ echo $interval > /sys/class/leds/${sysfs}/interval 2>/dev/null
}
;;
[ -s /var/run/led.state ] && {
local led trigger brightness color
while read led trigger brightness color; do
+ [ "$1" ] && [ "$1" != "$led" ] && continue
[ -e "/sys/class/leds/$led/trigger" ] && \
echo "$trigger" > "/sys/class/leds/$led/trigger"
}
config_load system
- config_foreach load_led led
+ config_foreach load_led led "$1"
}
}