base-files: don't wipe LED state when adding a single LED
Only replace LED state of a single LED instead of removing the entire
/var/run/led.state file.
Fixes: 511e8f84d0
("base-files: configure LED when added")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
parent
0b05cc7048
commit
dae6a871de
1 changed files with 6 additions and 1 deletions
|
@ -184,7 +184,12 @@ start() {
|
||||||
echo "$color" | sed 's/:/\ /g' > \
|
echo "$color" | sed 's/:/\ /g' > \
|
||||||
"/sys/class/leds/$led/multi_intensity"
|
"/sys/class/leds/$led/multi_intensity"
|
||||||
done < /var/run/led.state
|
done < /var/run/led.state
|
||||||
rm /var/run/led.state
|
if [ "$1" ]; then
|
||||||
|
grep -v "^$1 " /var/run/led.state > /var/run/led.state.new
|
||||||
|
mv /var/run/led.state.new /var/run/led.state
|
||||||
|
else
|
||||||
|
rm /var/run/led.state
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
config_load system
|
config_load system
|
||||||
|
|
Loading…
Reference in a new issue