added -r for Reset Count and -l for Lat and Long configuration

pull/85/head
alanbjohnston 5 years ago committed by GitHub
parent b5376bfaf0
commit f48330a317
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,36 +51,25 @@ elif [ "$1" = "-h" ]; then
elif [ "$1" = "-c" ]; then elif [ "$1" = "-c" ]; then
echo echo
echo "Editing the CALLSIGN in the" echo "Editing the CALLSIGN in the"
echo "configuration file for CubeSatSim"
echo "configuration file for CubeSatSim"
echo echo
echo "Return keeps current value." echo "Return keeps current value."
# echo -e "Current sim.cfg configuration file:"
# echo -e "Current sim.cfg configuration file:"
# echo # echo
value=`cat sim.cfg` value=`cat sim.cfg`
echo "$value" > /dev/null echo "$value" > /dev/null
set -- $value set -- $value
echo "Current value of CALLSIGN is" echo "Current value of CALLSIGN is"
echo $1 echo $1
echo echo
# echo $1 $2 $3 $4 # echo $1 $2 $3 $4
echo -e "Enter callsign in all capitals: " echo "Enter callsign in all capitals: "
read callsign read callsign
if [ -z $callsign ] ; then if [ -z $callsign ] ; then
@ -88,8 +77,38 @@ elif [ "$1" = "-c" ]; then
callsign="$1" callsign="$1"
echo "Keeping value of" $callsign echo "Keeping value of" $callsign
fi fi
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $callsign $2 $3 $4
echo -e "Input reset count (integer): " echo $callsign $2 $3 $4 > sim.cfg
echo "Restarting CubeSatSim with new configuraation file"
sudo systemctl restart cubesatsim
elif [ "$1" = "-r" ]; then
echo
echo "Editing the Reset Cou t in the"
echo "configuration file for CubeSatSim"
echo
echo "Return keeps current value."
# echo -e "Current sim.cfg configuration file:"
# echo
value=`cat sim.cfg`
echo "$value" > /dev/null
set -- $value
echo "Current value of Reset Count is"
echo $2
echo
# echo $1 $2 $3 $4
echo -e "Enter Reset Count (integer): "
read resets read resets
@ -104,7 +123,38 @@ elif [ "$1" = "-c" ]; then
echo "Keeping value of" $resets echo "Keeping value of" $resets
fi fi
echo -e "Input latitude (decimal degrees, positive is north): " echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $1 $resets $3 $4
echo $1 $resets $3 $4 > sim.cfg
echo "Restarting CubeSatSim with new configuraation file"
sudo systemctl restart cubesatsim
elif [ "$1" = "-l" ]; then
echo
echo "Editing latitude and longitude in the"
echo "configuration file for CubeSatSim"
echo "(Only used for APRS telemetry)
echo
echo "Return keeps current value."
# echo -e "Current sim.cfg configuration file:"
# echo
value=`cat sim.cfg`
echo "$value" > /dev/null
set -- $value
echo "Current value of latitude is"
echo $3
echo
# echo $1 $2 $3 $4
echo -e "Enter latitude (decimal degrees, positive is north): "
read lat read lat
@ -120,8 +170,12 @@ elif [ "$1" = "-c" ]; then
lat="$3" lat="$3"
echo "Keeping value of" $lat echo "Keeping value of" $lat
fi fi
echo "Current value of longitude is"
echo $4
echo
echo -e "Input longitude (decimal degrees, positive is east): " echo -e "Enter longitude (decimal degrees, positive is east): "
read long read long
@ -140,12 +194,13 @@ 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 $resets $lat $long echo $1 $2 $lat $long
echo $callsign $resets $lat $long > sim.cfg echo $1 $2 $lat $long > sim.cfg
echo "Restarting CubeSatSim with new configuraation file" echo "Restarting CubeSatSim with new configuraation file"
sudo systemctl restart cubesatsim
fi fi
sudo systemctl restart cubesatsim sudo systemctl restart cubesatsim

Loading…
Cancel
Save

Powered by TurnKey Linux.