Update config change from battery saver to safe mode

beta-cc-safe
Alan Johnston 2 years ago committed by GitHub
parent 56d9777469
commit 2fdca3524a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -70,6 +70,7 @@ if [ "$1" = "" ]; then
FILE=/home/pi/CubeSatSim/battery_saver FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "Safe Mode!"
echo "Battery saver mode is ON" echo "Battery saver mode is ON"
else else
echo "Battery saver mode is OFF" echo "Battery saver mode is OFF"
@ -100,6 +101,7 @@ elif [ "$1" = "-a" ]; then
FILE=/home/pi/CubeSatSim/battery_saver FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "Safe Mode!"
echo "Battery saver mode is ON." echo "Battery saver mode is ON."
# 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 else
@ -119,6 +121,7 @@ elif [ "$1" = "-m" ]; then
FILE=/home/pi/CubeSatSim/battery_saver FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "Safe Mode!"
echo "Battery saver mode is ON." echo "Battery saver mode is ON."
# 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 else
@ -154,6 +157,7 @@ elif [ "$1" = "-s" ]; then
FILE=/home/pi/CubeSatSim/battery_saver FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "Safe Mode!"
echo "Battery saver mode ON." echo "Battery saver mode ON."
# 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 else
@ -482,30 +486,32 @@ elif [ "$1" = "-R" ]; then
elif [ "$1" = "-B" ]; then elif [ "$1" = "-B" ]; then
echo echo
echo "Manually setting battery saver mode" echo "Manually setting Safe Mode (battery saver mode)"
echo echo
FILE=/home/pi/CubeSatSim/battery_saver FILE=/home/pi/CubeSatSim/battery_saver
if [ -f "$FILE" ]; then if [ -f "$FILE" ]; then
echo "Safe Mode!"
echo "Battery saver mode is ON." echo "Battery saver mode is ON."
mode=1 mode=1
else else
echo "Safe Mode is OFF."
echo "Battery saver mode is OFF." echo "Battery saver mode is OFF."
mode=0 mode=0
fi fi
echo echo
echo "Do you want Battery saver mode ON (y/n) " echo "Do you want Safe Mode (battery saver mode) ON (y/n) "
read saver read saver
echo echo
if [ "$saver" = "y" ] || [ "$saver" = "yes" ] ; then if [ "$saver" = "y" ] || [ "$saver" = "yes" ] ; then
echo "Battery saver mode is now ON" echo "Safe Mode! Battery saver mode is now ON"
touch /home/pi/CubeSatSim/battery_saver touch /home/pi/CubeSatSim/battery_saver
# if ["$mode" = "0"] ; then sudo systemctl restart rpitx # if ["$mode" = "0"] ; then sudo systemctl restart rpitx
else else
echo "Battery saver mode is now OFF" echo "Safe Mode is OFF. Battery saver mode is now OFF"
sudo rm /home/pi/CubeSatSim/battery_saver sudo rm /home/pi/CubeSatSim/battery_saver
# if ["$mode" = "1"] ; then sudo systemctl restart rpitx # if ["$mode" = "1"] ; then sudo systemctl restart rpitx
fi fi
@ -704,7 +710,7 @@ elif [ "$1" = "-h" ]; then
echo " -C Clear logs" echo " -C Clear logs"
echo " -T Change command and control state" echo " -T Change command and control state"
echo " -R Change the Commands Count in the file command_count.txt" echo " -R Change the Commands Count in the file command_count.txt"
echo " -B Change battery saver mode manually" echo " -B Change Safe Mode (battery saver mode) manually"
echo " -q Change the Squelch setting for command receiver" echo " -q Change the Squelch setting for command receiver"
echo " -F Change the rx and tx frequency" echo " -F Change the rx and tx frequency"
echo " -H Chnage the Balloon mode" echo " -H Chnage the Balloon mode"

Loading…
Cancel
Save

Powered by TurnKey Linux.