From e046477303d7f48cb326ee16137c2a3d1b5c5e0d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Fri, 13 Mar 2026 16:57:18 -0400 Subject: [PATCH] Update config for -o start and stop pacsatsim --- config | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/config b/config index 73eae931..7d0ed195 100755 --- a/config +++ b/config @@ -1139,8 +1139,9 @@ elif [ "$1" = "-o" ]; then value=`cat /home/pi/CubeSatSim/.mode` echo "$value" > /dev/null set -- $value + MODE=$1 - if [ "$1" == "n" ]; then + if [ "$MODE" == "n" ]; then transmit_command "o" @@ -1151,34 +1152,27 @@ elif [ "$1" = "-o" ]; then FILE=/home/pi/CubeSatSim/beacon_off if [ -f "$FILE" ]; then - echo "Transmit beacon telemetry is off" -# echo -# echo "Do you want to turn beacon telemetry ON (y/n) " -# read reset - - reset="y" + echo "Transmit beacon telemetry is off" echo - if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then - echo "Turn beacon telemetry ON" - sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 - sudo systemctl restart transmit - # restart=1 + echo "Turn beacon telemetry ON" + sudo rm /home/pi/CubeSatSim/beacon_off > /dev/null 2>&1 + sudo systemctl restart transmit + if [ "$MODE" = "p" ]; then + sudo systemctl restart pacsatsim fi else - echo "Transmit beacon telemetry is on" -# echo -# echo "Do you want to turn beacon telemetry OFF (y/n) " -# read reset - reset="y" + echo "Transmit beacon telemetry is on" echo - if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then - echo "Turn beacon telemetry OFF" - touch /home/pi/CubeSatSim/beacon_off + echo "Turn beacon telemetry OFF" + touch /home/pi/CubeSatSim/beacon_off + if [ "$MODE" = "p" ]; then + sudo systemctl stop pacsatsim + sudo systemctl stop transmit + else sudo systemctl restart transmit - # restart=1 fi fi sleep 3