|
|
|
|
@ -74,10 +74,12 @@ elif [ "$1" = "-a" ]; then
|
|
|
|
|
echo "Battery saver mode activated."
|
|
|
|
|
if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
|
|
|
|
|
sudo sed -i ':a;N;$!ba;s/\ndtoverlay=pwm,pin=18,func=2//g' /boot/config.txt
|
|
|
|
|
sudo sed -i ':a;N;$!ba;s/\ndtoverlay=audremap,enable_jack=on//g' /boot/config.txt
|
|
|
|
|
else
|
|
|
|
|
echo "Not battery saver mode"
|
|
|
|
|
sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
|
|
|
|
|
if ! grep -q dtoverlay=pwm,pin=18,func=2 /boot/config.txt ; then sudo sh -c 'echo "\ndtoverlay=pwm,pin=18,func=2" >> /boot/config.txt'; fi
|
|
|
|
|
if ! grep -q dtoverlay=audremap,enable_jack=on /boot/config.txt ; then sudo sh -c 'echo "\ndtoverlay=audremap,enable_jack=on" >> /boot/config.txt'; fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "rebooting"
|
|
|
|
|
|