Make sense of LED value consistent between do_ and get_

This commit is contained in:
Simon Long 2020-09-02 13:55:40 +01:00
parent 13d220fa1e
commit 05561e206b

View File

@ -1119,18 +1119,16 @@ do_pi4video() {
get_leds () { get_leds () {
if grep -q "\\[actpwr\\]" /sys/class/leds/led0/trigger ; then if grep -q "\\[actpwr\\]" /sys/class/leds/led0/trigger ; then
echo 1
else
echo 0 echo 0
else
echo 1
fi fi
} }
do_leds() { do_leds() {
DEFAULT=--defaultno DEFAULT=--defaultno
CURRENT=0 if [ $(get_leds) -eq 0 ]; then
if [ $(get_leds) -eq 1 ]; then
DEFAULT= DEFAULT=
CURRENT=1
fi fi
if [ "$INTERACTIVE" = True ]; then if [ "$INTERACTIVE" = True ]; then
whiptail --yesno "Would you like the power LED to flash during disk activity?" $DEFAULT 20 60 2 whiptail --yesno "Would you like the power LED to flash during disk activity?" $DEFAULT 20 60 2