From ec5578ca8b8c421e713d415f9e30ecff33a80350 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 22 Jul 2024 12:27:55 -0400 Subject: [PATCH] Update config don't reboot if in safe mode (battery saver) --- config | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/config b/config index 3c6f1faf..8eca1066 100755 --- a/config +++ b/config @@ -366,8 +366,12 @@ elif [ "$1" = "-a" ]; then echo "changing CubeSatSim to AFSK mode" sudo echo "a" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] ; then -# restart=1 - reboot=1 + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 + else + reboot=1 + fi else restart=1 fi @@ -388,8 +392,12 @@ elif [ "$1" = "-m" ]; then echo "changing CubeSatSim to CW mode" sudo echo "m" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] ; then - reboot=1 -# restart=1 + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 + else + reboot=1 + fi else restart=1 fi @@ -444,8 +452,13 @@ elif [ "$1" = "-s" ]; then echo "changing CubeSatSim to SSTV mode" sudo echo "s" > /home/pi/CubeSatSim/.mode if [ "$1" == "f" ] || [ "$1" == "b" ] ; then - reboot=1 -# restart=1 + + FILE=/home/pi/CubeSatSim/battery_saver + if [ -f "$FILE" ]; then + restart=1 + else + reboot=1 + fi else restart=1 fi