From 32b8cced1a9ad1a847ad3b5a15ec38aece19be38 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Mon, 15 Jul 2024 11:22:24 -0400 Subject: [PATCH] Update config -n toggles transmit C&C mode --- config | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/config b/config index aec9bf5f..afc9c020 100755 --- a/config +++ b/config @@ -1207,9 +1207,21 @@ elif [ "$1" = "-e" ]; then elif [ "$1" = "-n" ]; then echo "changing CubeSatSim to Transmit Command and Control mode" - sudo echo "n" > /home/pi/CubeSatSim/.mode - restart=1 + value=`cat /home/pi/CubeSatSim/.mode` + echo "$value" > /dev/null + set -- $value + + if [ "$1" = "n" ]; then + echo "Turning Transmit Command and Control mode OFF" + echo "Switching to FSK mode" + sudo echo "f" > /home/pi/CubeSatSim/.mode + reboot=1 + else + echo "Turning Transmit Command and Control mode ON" + sudo echo "n" > /home/pi/CubeSatSim/.mode + restart=1 + fi elif [ "$1" = "-A" ]; then