mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 12:10:07 +09:00
Remove real-time fan settings; fix cancel option in fan menus
This commit is contained in:
parent
df076dce04
commit
01ac59b8f5
12
raspi-config
12
raspi-config
@ -1213,6 +1213,9 @@ do_fan() {
|
|||||||
GPIO=$2
|
GPIO=$2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if ! [ $? -eq 0 ] ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
if ! echo "$GPIO" | grep -q ^[[:digit:]]*$ ; then
|
if ! echo "$GPIO" | grep -q ^[[:digit:]]*$ ; then
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
whiptail --msgbox "GPIO must be a number between 2 and 27" 20 60 1
|
whiptail --msgbox "GPIO must be a number between 2 and 27" 20 60 1
|
||||||
@ -1234,6 +1237,9 @@ do_fan() {
|
|||||||
TIN=$3
|
TIN=$3
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if ! [ $? -eq 0 ] ; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
if ! echo "$TIN" | grep -q ^[[:digit:]]*$ ; then
|
if ! echo "$TIN" | grep -q ^[[:digit:]]*$ ; then
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
whiptail --msgbox "Temperature must be a number between 60 and 120" 20 60 1
|
whiptail --msgbox "Temperature must be a number between 60 and 120" 20 60 1
|
||||||
@ -1257,13 +1263,15 @@ do_fan() {
|
|||||||
else
|
else
|
||||||
sed $CONFIG -i -e "s/^.*dtoverlay=gpio-fan.*/dtoverlay=gpio-fan,gpio_pin=$GPIO,temp=$TEMP/"
|
sed $CONFIG -i -e "s/^.*dtoverlay=gpio-fan.*/dtoverlay=gpio-fan,gpio_pin=$GPIO,temp=$TEMP/"
|
||||||
fi
|
fi
|
||||||
dtoverlay gpio-fan gpiopin=$GPIO temp=$TEMP
|
ASK_TO_REBOOT=1
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
whiptail --msgbox "The fan on GPIO $GPIO is enabled and will turn on at $TIN degrees" 20 60 1
|
whiptail --msgbox "The fan on GPIO $GPIO is enabled and will turn on at $TIN degrees" 20 60 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
if grep -q "^dtoverlay=gpio-fan" $CONFIG ; then
|
||||||
|
ASK_TO_REBOOT=1
|
||||||
|
fi
|
||||||
sed $CONFIG -i -e "/^.*dtoverlay=gpio-fan.*/d"
|
sed $CONFIG -i -e "/^.*dtoverlay=gpio-fan.*/d"
|
||||||
dtoverlay -r gpio-fan
|
|
||||||
if [ "$INTERACTIVE" = True ]; then
|
if [ "$INTERACTIVE" = True ]; then
|
||||||
whiptail --msgbox "The fan is disabled" 20 60 1
|
whiptail --msgbox "The fan is disabled" 20 60 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user