Update config no config,txt change

beta-v1.3.1.1-hab-3
Alan Johnston 2 years ago committed by GitHub
parent 8581a490b0
commit 9a5390f309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -92,10 +92,10 @@ elif [ "$1" = "-a" ]; then
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; 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
# if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
else
echo "Not battery saver mode"
sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
# sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
fi
echo "rebooting"
@ -109,10 +109,10 @@ elif [ "$1" = "-m" ]; then
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; 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
# if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
else
echo "Not battery saver mode"
sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
# sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
fi
echo "rebooting"
sudo reboot now
@ -121,7 +121,7 @@ elif [ "$1" = "-m" ]; then
elif [ "$1" = "-f" ]; then
echo "changing CubeSatSim to FSK mode"
sudo echo "f" > /home/pi/CubeSatSim/.mode
if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
# if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
echo "rebooting"
sudo reboot now
# sudo systemctl restart cubesatsim
@ -129,7 +129,7 @@ elif [ "$1" = "-f" ]; then
elif [ "$1" = "-b" ]; then
echo "changing CubeSatSim to BPSK mode"
sudo echo "b" > /home/pi/CubeSatSim/.mode
if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
# if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
echo "rebooting"
sudo reboot now
# sudo systemctl restart cubesatsim
@ -141,10 +141,10 @@ elif [ "$1" = "-s" ]; then
FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; 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
# if ! grep -q force_turbo=1 /boot/config.txt ; then sudo sh -c 'echo "force_turbo=1" >> /boot/config.txt'; fi
else
echo "Not battery saver mode"
sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
# sudo sed -i ':a;N;$!ba;s/\nforce_turbo=1//g' /boot/config.txt
fi
echo "rebooting"
sudo reboot now

Loading…
Cancel
Save

Powered by TurnKey Linux.