|
|
|
|
@ -1188,25 +1188,24 @@ elif [ "$1" = "-F" ]; then
|
|
|
|
|
rx="$8"
|
|
|
|
|
echo "Keeping value of" $rx
|
|
|
|
|
fi
|
|
|
|
|
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
|
|
|
|
|
|
|
|
|
|
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13}
|
|
|
|
|
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Restarting CubeSatSim with new configuration file"
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
|
|
echo -e "\nCubeSatSim configuration sim.cfg file updated to: \n"
|
|
|
|
|
|
|
|
|
|
if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then
|
|
|
|
|
sudo systemctl restart transmit
|
|
|
|
|
else
|
|
|
|
|
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13}
|
|
|
|
|
echo $1 $2 $3 $4 $5 $6 $tx $rx $9 ${10} ${11} ${12} ${13} > /home/pi/CubeSatSim/sim.cfg
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
# if [ "$norestart" = "1" ]; then
|
|
|
|
|
# echo
|
|
|
|
|
# else
|
|
|
|
|
echo
|
|
|
|
|
echo "temporarily disabling gpsd and rebooting to program FM module"
|
|
|
|
|
echo "this will take about 40 seconds"
|
|
|
|
|
sudo systemctl stop gpsd.socket
|
|
|
|
|
echo "Restarting CubeSatSim with new configuration file"
|
|
|
|
|
## echo
|
|
|
|
|
# reboot=1
|
|
|
|
|
## sudo reboot now
|
|
|
|
|
sudo systemctl restart transmit
|
|
|
|
|
sleep 10
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-o" ]; then
|
|
|
|
|
|
|
|
|
|
@ -1772,47 +1771,7 @@ elif [ "$1" = "-U" ]; then
|
|
|
|
|
if [ "${12}" != "$sim" ] || [ "${13}" != "$time" ] ; then
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-u" ]; then
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "Change gpsd state"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [[ $(sudo systemctl is-active gpsd.socket | grep inactive) ]]; then
|
|
|
|
|
echo "gpsd is inactive"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to turn gpsd to ON (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
echo "gpsd set to ON"
|
|
|
|
|
sudo systemctl enable gpsd
|
|
|
|
|
sudo systemctl enable gpsd.socket
|
|
|
|
|
echo
|
|
|
|
|
echo "Unless you configure gpsd otherwise, the gps is connected to serial0 on the Pi."
|
|
|
|
|
echo "To monitor your gps device, use the command gpsmon"
|
|
|
|
|
echo
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
echo "gpsd is active"
|
|
|
|
|
echo
|
|
|
|
|
echo "Do you want to turn gpsd to OFF (y/n) "
|
|
|
|
|
read reset
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
if [ "$reset" = "y" ] || [ "$reset" = "yes" ] ; then
|
|
|
|
|
echo "gpsd set to OFF"
|
|
|
|
|
sudo systemctl disable gpsd
|
|
|
|
|
sudo systemctl disable gpsd.socket
|
|
|
|
|
reboot=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif [ "$1" = "-h" ]; then
|
|
|
|
|
|
|
|
|
|
echo "config OPTION"
|
|
|
|
|
|