From 399ac618f8872d861c3c738afda7a217cb573cfb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 14 Jun 2021 07:40:44 -0400 Subject: [PATCH] added in groundstation/.profile setting but don't do anything with it yet. --- groundstation/fox-startup.sh | 44 +++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/groundstation/fox-startup.sh b/groundstation/fox-startup.sh index a0ade800..d5f5edf9 100755 --- a/groundstation/fox-startup.sh +++ b/groundstation/fox-startup.sh @@ -1,10 +1,52 @@ #!/bin/bash # script to run FoxTelem -echo "Script to run FoxTelem for ARISS Radio Pi" +echo "Startup script to run FoxTelem for ARISS Radio Pi" echo +FILE=/home/pi/CubeSatSim/groundstation/.profile +if [ ! -f "$FILE" ]; then + echo "You need to choose your default FoxTelem profile." + echo + echo "The choices are:" + echo + echo "1. Fox-in-a-Box. Use this profile if you want to receive and decode telemetry from the AMSAT Fox satellites. If you enter a callsign and a grid square, you can upload to the AMSAT telemetry server." + echo + echo "2. CubeSatSim Ground Station. Use this profile if you want to receive and decode telemetry from an AMSAT CubeSatSim or CubeSatSim Lite." + echo + echo "Which profile do choose? Enter 1 or 2" + + read -r ANS + + if [ "$ANS" = "1" ]; then + + echo "You have chosen the Fox-in-a-Box profile." + echo "b" > /home/pi/CubeSatSim/groundstation/.profile + + elif [ "$ANS" = "2" ]; then + + echo "You have chosen the CubeSatSim Ground Station profile." + echo "c" > /home/pi/CubeSatSim/groundstation/.profile + + else + + echo "Please enter only 1 or 2" + + fi + +else + + value=`cat /home/pi/CubeSatSim/groundstation/.profile` + echo "$value" > /dev/null + set -- $value + + if [ "$1" = "b" ]; then + echo "Fox-in-a-box profile is set!" + elif [ "$1" = "c" ]; then + echo "CubeSatSim Ground Station profile is set!" + +fi sudo killall -9 foxtelem &>/dev/null