mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Do not allow LED operation to be changed unless it is already in a valid state
This commit is contained in:
parent
05561e206b
commit
2125ae6d18
13
raspi-config
13
raspi-config
@ -1120,14 +1120,23 @@ do_pi4video() {
|
||||
get_leds () {
|
||||
if grep -q "\\[actpwr\\]" /sys/class/leds/led0/trigger ; then
|
||||
echo 0
|
||||
else
|
||||
elif grep -q "\\[default-on\\]" /sys/class/leds/led0/trigger ; then
|
||||
echo 1
|
||||
else
|
||||
echo -1
|
||||
fi
|
||||
}
|
||||
|
||||
do_leds() {
|
||||
CURRENT=$(get_leds)
|
||||
if [ $CURRENT -eq -1 ] ; then
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
whiptail --msgbox "The LED behaviour cannot be changed on this model of Raspberry Pi" 20 60 1
|
||||
fi
|
||||
return 1
|
||||
fi
|
||||
DEFAULT=--defaultno
|
||||
if [ $(get_leds) -eq 0 ]; then
|
||||
if [ $CURRENT -eq 0 ]; then
|
||||
DEFAULT=
|
||||
fi
|
||||
if [ "$INTERACTIVE" = True ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user