Update config adding -F change rx and tx frequency

beta-v1.3.1-freq
Alan Johnston 2 years ago committed by GitHub
parent 3cf2791e48
commit 263deb3766
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,7 +55,7 @@ if [ "$1" = "" ]; then
echo -e "Current sim.cfg configuration file:" echo -e "Current sim.cfg configuration file:"
echo echo
echo $1 $2 $3 $4 $5 $6 echo $1 $2 $3 $4 $5 $6 $7 $8
echo echo
echo "To change, include an OPTION" echo "To change, include an OPTION"
@ -130,6 +130,7 @@ elif [ "$1" = "-h" ]; then
echo " -T Change command state" echo " -T Change command state"
echo " -R Change the Commands Count in the file command_count.txt" echo " -R Change the Commands Count in the file command_count.txt"
echo " -q Change the Squelch setting for command receiver" echo " -q Change the Squelch setting for command receiver"
echo " -F Change the rx and tx frequency"
echo echo
exit exit
@ -152,7 +153,7 @@ elif [ "$1" = "-t" ]; then
echo echo
# echo $1 $2 $3 $4 $5 $6 # echo $1 $2 $3 $4 $5 $6 $7 $8
echo "Do you want Simulated Telemetry ON (y/n) " echo "Do you want Simulated Telemetry ON (y/n) "
read sim read sim
@ -169,8 +170,8 @@ elif [ "$1" = "-t" ]; then
echo echo
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo echo
echo $1 $2 $3 $4 $sim $6 echo $1 $2 $3 $4 $sim $6 $7 $8
echo $1 $2 $3 $4 $sim $6 > /home/pi/CubeSatSim/sim.cfg echo $1 $2 $3 $4 $sim $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg
echo echo
echo "Restarting CubeSatSim with new configuraation file" echo "Restarting CubeSatSim with new configuraation file"
echo echo
@ -195,7 +196,7 @@ elif [ "$1" = "-c" ]; then
echo $1 echo $1
echo echo
# echo $1 $2 $3 $4 $5 $6 # echo $1 $2 $3 $4 $5 $6 $7 $8
echo "Enter callsign in all capitals: " echo "Enter callsign in all capitals: "
read callsign read callsign
@ -209,8 +210,8 @@ elif [ "$1" = "-c" ]; then
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $callsign $2 $3 $4 $5 $6 echo $callsign $2 $3 $4 $5 $6 $7 $8
echo $callsign $2 $3 $4 $5 $6 > /home/pi/CubeSatSim/sim.cfg echo $callsign $2 $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg
fi fi
if [ "$norestart" = "1" ]; then if [ "$norestart" = "1" ]; then
@ -241,7 +242,7 @@ elif [ "$1" = "-r" ]; then
echo $2 echo $2
echo echo
# echo $1 $2 $3 $4 $5 $6 # echo $1 $2 $3 $4 $5 $6 $7 $8
echo -e "Enter Reset Count (integer): " echo -e "Enter Reset Count (integer): "
@ -261,8 +262,8 @@ elif [ "$1" = "-r" ]; then
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $1 $resets $3 $4 $5 $6 echo $1 $resets $3 $4 $5 $6 $7 $8
echo $1 $resets $3 $4 $5 $6 > /home/pi/CubeSatSim/sim.cfg echo $1 $resets $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg
fi fi
if [ "$norestart" = "1" ]; then if [ "$norestart" = "1" ]; then
@ -294,7 +295,7 @@ elif [ "$1" = "-l" ]; then
echo $3 echo $3
echo echo
# echo $1 $2 $3 $4 $5 $6 # echo $1 $2 $3 $4 $5 $6 $7 $8
echo -e "Enter latitude (decimal degrees, positive is north): " echo -e "Enter latitude (decimal degrees, positive is north): "
@ -336,8 +337,8 @@ elif [ "$1" = "-l" ]; then
fi fi
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $1 $2 $lat $long $5 $6 echo $1 $2 $lat $long $5 $6 $7 $8
echo $1 $2 $lat $long $5 $6 > /home/pi/CubeSatSim/sim.cfg echo $1 $2 $lat $long $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg
if [ "$norestart" = "1" ]; then if [ "$norestart" = "1" ]; then
echo echo
@ -441,7 +442,7 @@ elif [ "$1" = "-q" ]; then
echo $6 echo $6
echo echo
# echo $1 $2 $3 $4 $5 $6 # echo $1 $2 $3 $4 $5 $6 $7 $8
echo -e "Enter squelch (integer 0 - 8): " echo -e "Enter squelch (integer 0 - 8): "
@ -463,14 +464,71 @@ elif [ "$1" = "-q" ]; then
echo echo
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo echo
echo $1 $2 $3 $4 $5 $sq echo $1 $2 $3 $4 $5 $sq $7 $8
echo $1 $2 $3 $4 $4 $sq > /home/pi/CubeSatSim/sim.cfg echo $1 $2 $3 $4 $4 $sq $7 $8 > /home/pi/CubeSatSim/sim.cfg
echo echo
echo "Restarting CubeSatSim with new configuraation file" echo "Restarting CubeSatSim with new configuraation file"
echo echo
sudo systemctl restart cubesatsim sudo systemctl restart cubesatsim
elif [ "$1" = "-F" ]; then
echo
echo "Editing the tx and rx frequency in the"
echo "configuration file for CubeSatSim"
echo
echo "Return keeps current value."
# echo -e "Current sim.cfg configuration file:"
# echo
value=`cat /home/pi/CubeSatSim/sim.cfg`
echo "$value" > /dev/null
set -- $value
echo "Current value of tx is"
echo $7
echo
echo "Current value of rx is"
echo $8
echo
# echo $1 $2 $3 $4 $5 $6 $7 $8
echo "Enter tx frequency as 4XX.XXXX: "
read tx
if [ -z $tx ] ; then
tx="$7"
echo "Keeping value of" $tx
fi
echo "Enter rx frequency as 4XX.XXXX: "
read rx
if [ -z $rx ] ; then
rx="$8"
echo "Keeping value of" $rx
# else
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $callsign $2 $3 $4 $5 $6 $7 $8
echo $callsign $2 $3 $4 $5 $6 $7 $8 > /home/pi/CubeSatSim/sim.cfg
fi
# if [ "$norestart" = "1" ]; then
# echo
# else
echo
echo "Restarting CubeSatSim with new configuraation file"
echo
sudo systemctl restart cubesatsim
# fi
fi fi
# sudo systemctl restart cubesatsim # sudo systemctl restart cubesatsim

Loading…
Cancel
Save

Powered by TurnKey Linux.