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