|
|
|
|
@ -699,7 +699,6 @@ elif [ "$1" = "-l" ]; then
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
@ -713,42 +712,59 @@ elif [ "$1" = "-l" ]; then
|
|
|
|
|
|
|
|
|
|
# echo $1 $2 $3 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14}
|
|
|
|
|
|
|
|
|
|
echo -e "Enter latitude (decimal degrees, positive is north): "
|
|
|
|
|
if [ -z "$param2" ] ; then
|
|
|
|
|
|
|
|
|
|
read lat
|
|
|
|
|
echo "Return keeps current value."
|
|
|
|
|
echo
|
|
|
|
|
echo -e "Enter latitude (decimal degrees, positive is north): "
|
|
|
|
|
|
|
|
|
|
read lat
|
|
|
|
|
|
|
|
|
|
if [ -z $lat ] ; then
|
|
|
|
|
|
|
|
|
|
lat="$3"
|
|
|
|
|
echo "Keeping value of" $lat
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Current value of longitude is" $4
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
echo -e "Enter longitude (decimal degrees, positive is east): "
|
|
|
|
|
|
|
|
|
|
read long
|
|
|
|
|
|
|
|
|
|
if [ -z $long ] ; then
|
|
|
|
|
|
|
|
|
|
long="$4"
|
|
|
|
|
echo "Keeping value of" $long
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -z $lat ] ; then
|
|
|
|
|
|
|
|
|
|
lat="$3"
|
|
|
|
|
echo "Keeping value of" $lat
|
|
|
|
|
else
|
|
|
|
|
lat="$param2"
|
|
|
|
|
echo "Changing Latitude to" $lat
|
|
|
|
|
if [ -z "$param3" ] ; then
|
|
|
|
|
lon="$3"
|
|
|
|
|
echo "Keeping Longitude of" $lon
|
|
|
|
|
else
|
|
|
|
|
long="$param3"
|
|
|
|
|
echo "Changing Longitude to" $long
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
|
|
|
|
|
if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
|
|
|
|
|
|
|
|
|
|
echo "Error: not a number!"
|
|
|
|
|
lat="$3"
|
|
|
|
|
echo "Keeping value of" $lat
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Current value of longitude is" $4
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
echo -e "Enter longitude (decimal degrees, positive is east): "
|
|
|
|
|
|
|
|
|
|
read long
|
|
|
|
|
|
|
|
|
|
if [ -z $long ] ; then
|
|
|
|
|
|
|
|
|
|
long="$4"
|
|
|
|
|
echo "Keeping value of" $long
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
|
|
|
|
|
if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then
|
|
|
|
|
|
|
|
|
|
echo "Error: not a number!"
|
|
|
|
|
long="$4"
|
|
|
|
|
echo "Keeping value of" $long
|
|
|
|
|
lat="$3"
|
|
|
|
|
echo "Keeping value of" $lat
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
|
|
|
|
|
@ -758,12 +774,7 @@ elif [ "$1" = "-l" ]; then
|
|
|
|
|
if [ "$norestart" = "1" ]; then
|
|
|
|
|
echo
|
|
|
|
|
else
|
|
|
|
|
## echo
|
|
|
|
|
## echo "Rebooting CubeSatSim with new configuration file"
|
|
|
|
|
## echo
|
|
|
|
|
reboot=1
|
|
|
|
|
## sudo reboot now
|
|
|
|
|
# sudo systemctl restart cubesatsim
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-S" ]; then
|
|
|
|
|
|