mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-18 21:28:02 +00:00
base-files: fix shell scope error for the default LED brightness
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>
This commit is contained in:
parent
15e173bf7e
commit
3c7134fa32
@ -106,9 +106,10 @@ load_led() {
|
|||||||
[ "$default" = 0 ] &&
|
[ "$default" = 0 ] &&
|
||||||
echo 0 >/sys/class/leds/${sysfs}/brightness
|
echo 0 >/sys/class/leds/${sysfs}/brightness
|
||||||
|
|
||||||
[ $default = 1 ] &&
|
[ "$default" = 1 ] && {
|
||||||
[ -z "$brightness" ] && brightness=$(cat /sys/class/leds/${sysfs}/max_brightness)
|
[ -z "$brightness" ] && brightness="$(cat /sys/class/leds/${sysfs}/max_brightness)"
|
||||||
echo $brightness > /sys/class/leds/${sysfs}/brightness
|
echo "$brightness" > /sys/class/leds/${sysfs}/brightness
|
||||||
|
}
|
||||||
|
|
||||||
led_color_set "$1" "$sysfs"
|
led_color_set "$1" "$sysfs"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user