Update pacsat-config.sh add main and simulated

pacsat-v2.2-tlm3
Alan Johnston 3 weeks ago committed by GitHub
parent 4025dca6c1
commit 8d672cccb6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,22 +19,18 @@ sudo killall -9 direwolf &>/dev/null
# profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat") # profile=$(zenity --text="Choice:" --list 2>/dev/null --width=410 --height=120 --title="PacSat Ground Station Choice" --column="Choice" --column="Result" "PacSat" "Receive from CubeSatSim PacSatSim" "Configure" "Configure PacSat Ground Station" "Loopback" "Run a Locally Simulated PacSat")
# echo $profile # echo $profile
echo "Here are the PacSat Ground Station configuration choices:" echo "Here are the PacSat configuration choices:"
echo echo
echo "1. Set PacSat Ground Station Callsign" echo "1. PacSat Ground Station Configuration"
echo echo
echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration" echo "2. PacSat Ground Station Loopback Configuration"
echo
echo "3. Set Frequencies"
echo echo
echo "4. Reset PacSat Ground Station Configuration" echo "3. Set Frequencies"
echo
echo "5. Reset PacSat Ground Station Loopback Configuration"
echo
echo "6. Reset PacSat Satellite"
echo echo
echo "Which do you choose? Enter 1 - 5" echo "4. Reset PacSat Satellite"
echo
echo "Which do you choose? Enter 1 - 4"
read -r ANS read -r ANS
if [ -z "$ANS" ]; then if [ -z "$ANS" ]; then
@ -48,42 +44,106 @@ sudo killall -9 direwolf &>/dev/null
fi fi
if [ "$ANS" = "1" ] ; then if [ "$ANS" = "1" ] ; then
echo "Here are your PacSat Ground Station Configuration choices:"
echo
echo "1. PacSat Ground Station Callsign"
echo
echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration"
echo
echo "3. Reset PacSat Ground Station Configuration"
read -r ANS
echo "You have chosen to set the PacSat Ground Station Callsign"
echo if [ -z "$ANS" ]; then
/home/pi/CubeSatSim/config -c n echo "No choice made. Exiting."
elif [ "$ANS" = "2" ] ; then sleep 3
echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration" exit
echo
fi
oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties) if [ "$ANS" = "1" ] ; then
echo "Current value of remote PacSat callsign is" oldcallsign=$(grep -oP '(?<=callsign=).*$' /home/pi/PacSatGround/PacSatGround.properties)
echo $oldcallsign
echo
echo "Enter new callsign in all capitals: " echo "Callsign in PacSatGround.properties is "
read callsign echo $oldcallsign
if [ -z $callsign ] ; then echo "Enter new callsign in all capitals: "
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $oldcallsign
callsign="$1" else
echo "Keeping value of" $oldcallsign
echo "Configured callsign is "
else echo $callsign
if [ ! "$callsign" = "$oldcallsign" ] ; then
sudo sed -i "s/callsign=$oldcallsign/callsign=$callsign/g" /home/pi/PacSatGround/PacSatGround.properties
cat /home/pi/PacSatGround/PacSatGround.properties
fi
elif [ "$ANS" = "2" ] ; then
sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties echo "You have chosen to set the remote CubeSatSim PacSat Satellite callsign in ground station configuration"
echo echo
echo "Changing callsign to "
echo $callsign oldcallsign=$(grep -oP '(?<=bbsCallsign=).*(?=-)' /home/pi/PacSatGround/spacecraft/PacSatSim.properties)
echo
echo "You will see the change next time you run the PacSat Ground Station" echo "Current value of remote PacSat callsign is"
echo $oldcallsign
echo echo
fi
echo "Enter new callsign in all capitals: "
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $oldcallsign
else
sudo sed -i "s/$oldcallsign/$callsign/g" /home/pi/PacSatGround/spacecraft/PacSatSim.properties
echo
echo "Changing callsign to "
echo $callsign
echo
echo "You will see the change next time you run the PacSat Ground Station"
echo
fi
elif [ "$ANS" = "3" ] ; then
echo "You have chosen to reset the PacSat Ground Station Configuration"
echo
echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft"
echo
sudo rm -r /home/pi/PacSatGround
elif [ "$ANS" = "2" ] ; then
echo "Here are your PacSat Ground Station Loopback Configuration choices:"
echo
echo "1. PacSat Ground Station Callsign"
echo
echo "2. Set Remote PacSat Satellite Callsign in Ground Station configuration"
echo
echo "3. Reset PacSat Ground Station Configuration"
read -r ANS
elif [ "$ANS" = "3" ] ; then elif [ "$ANS" = "3" ] ; then
@ -92,25 +152,7 @@ sudo killall -9 direwolf &>/dev/null
/home/pi/CubeSatSim/config -F n /home/pi/CubeSatSim/config -F n
elif [ "$ANS" = "4" ] ; then elif [ "$ANS" = "4" ] ; then
echo "You have chosen to reset the PacSat Ground Station Configuration"
echo
echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft"
echo
sudo rm -r /home/pi/PacSatGround
elif [ "$ANS" = "5" ] ; then
echo "You have chosen to reset the PacSat Ground Station Loopback Configuration"
echo
echo "Next time you run the Ground Station you will need to Add the PacSatSim spacecraft"
echo
sudo rm -r /home/pi/PacSatGroundLoop
elif [ "$ANS" = "6" ] ; then
echo "You have chosen to reset the PacSat Satellite" echo "You have chosen to reset the PacSat Satellite"
echo echo
@ -119,7 +161,7 @@ sudo killall -9 direwolf &>/dev/null
else else
echo "Please enter only 1 to 5" echo "Please enter only 1 to 4"
fi fi

Loading…
Cancel
Save

Powered by TurnKey Linux.