projects
/
openwrt
/
staging
/
svanheule.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15e173b
)
base-files: fix shell scope error for the default LED brightness
author
Andre Heider
<
[email protected]
>
Sat, 14 Dec 2024 10:27:09 +0000
(11:27 +0100)
committer
John Crispin
<
[email protected]
>
Sat, 14 Dec 2024 18:51:50 +0000
(19:51 +0100)
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 <
[email protected]
>
Link:
https://github.com/openwrt/openwrt/issues/17269
Signed-off-by: John Crispin <
[email protected]
>
package/base-files/files/etc/init.d/led
patch
|
blob
|
history
diff --git
a/package/base-files/files/etc/init.d/led
b/package/base-files/files/etc/init.d/led
index d292e2a8dd1557693bb2cf160ab1521777b05133..79fdd452cecc03457898bcb08224631dedbc0a10 100755
(executable)
--- a/
package/base-files/files/etc/init.d/led
+++ b/
package/base-files/files/etc/init.d/led
@@
-106,9
+106,10
@@
load_led() {
[ "$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"