mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-18 21:28:02 +00:00
base-files/leds: merging code sequences that belongs together
Setting the trigger and checking whether the trigger can be set belong together and should not be interrupted by other lines of code. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
102855b3c1
commit
3aa812d8be
@ -65,12 +65,11 @@ load_led() {
|
||||
[ "$default" = 0 ] &&
|
||||
echo 0 >/sys/class/leds/${sysfs}/brightness
|
||||
|
||||
echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
|
||||
ret="$?"
|
||||
|
||||
[ $default = 1 ] &&
|
||||
cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness
|
||||
|
||||
echo $trigger > /sys/class/leds/${sysfs}/trigger 2> /dev/null
|
||||
ret="$?"
|
||||
[ $ret = 0 ] || {
|
||||
echo >&2 "Skipping trigger '$trigger' for led '$name' due to missing kernel module"
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user