This fixes "sh: write error: Invalid argument" for all default!=1 LEDs
as an empty $brightness was used.
Setting up LEDs via luci also now works again.
Fixes
cbdfd03e: "base-files: add option to set LED brightness"
Signed-off-by: Andre Heider <a.heider@gmail.com>
Link: https://github.com/openwrt/openwrt/issues/17269
Signed-off-by: John Crispin <john@phrozen.org>
[ "$default" = 0 ] &&
echo 0 >/sys/class/leds/${sysfs}/brightness
- [ $default = 1 ] &&
- [ -z "$brightness" ] && brightness=$(cat /sys/class/leds/${sysfs}/max_brightness)
- echo $brightness > /sys/class/leds/${sysfs}/brightness
+ [ "$default" = 1 ] && {
+ [ -z "$brightness" ] && brightness="$(cat /sys/class/leds/${sysfs}/max_brightness)"
+ echo "$brightness" > /sys/class/leds/${sysfs}/brightness
+ }
led_color_set "$1" "$sysfs"