From c8c7859e5a1b78497cf4b49bb0781472178bb8bc Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 19 Mar 2026 11:50:48 -0400 Subject: [PATCH] Update pacsat.sh check for PacSat Ground mode before running --- groundstation/pacsat.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/groundstation/pacsat.sh b/groundstation/pacsat.sh index 8cd8114d..879ae1ec 100755 --- a/groundstation/pacsat.sh +++ b/groundstation/pacsat.sh @@ -61,6 +61,44 @@ if [ -f "$FILE" ]; then fi +value=`cat /home/pi/CubeSatSim/.mode` +echo "$value" > /dev/null +set -- $value + +MODE=$1 + +if [ ! "$MODE" = "P" ] && [ ! "$loopback" = "1" ] ; then + + echo "Mode is not PacSat Ground Station" + echo + echo "Would you like to change to PacSat Ground Station mode and reboot? (y/n)?" + + read -r ANS + + if [ "$ANS" = "y" ]; then + + /home/pi/CubeSatSim/config -I + exit + + else + + echo "You can run the PacSat Ground Station after you change mode and reboot." + exit + + fi + +elif [ "$loopback" = "1" ] ; then + + echo "Simulated PacSatSim so mode doesn't matter" + echo + +else + + echo "Mode is PacSat Ground Station" + echo + +fi + value=`cat /home/pi/CubeSatSim/sim.cfg` echo "$value" > /dev/null set -- $value