added norestart to resets and lat long

pull/88/head
alanbjohnston 5 years ago committed by GitHub
parent 854d2a3867
commit db81d39e1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -163,59 +163,19 @@ elif [ "$1" = "-c" ]; then
callsign="$1" callsign="$1"
echo "Keeping value of" $callsign echo "Keeping value of" $callsign
fi norestart=1
echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n"
echo $callsign $2 $3 $4 $5
echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg
if [ "$norestart" = "1" ]; then
echo
else else
echo "Restarting CubeSatSim with new configuraation file"
echo
sudo systemctl restart cubesatsim
fi
elif [ "$1" = "-c" ]; then
echo
echo "Editing the CALLSIGN 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 CALLSIGN is"
echo $1
echo
# echo $1 $2 $3 $4 $5
echo "Enter callsign in all capitals: "
read callsign
if [ -z $callsign ] ; then
callsign="$1"
echo "Keeping value of" $callsign
fi
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 echo $callsign $2 $3 $4 $5
echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo $callsign $2 $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg
echo fi
if [ "$norestart" = "1" ]; then if [ "$norestart" = "1" ]; then
echo echo "no changes"
else else
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
@ -255,17 +215,24 @@ elif [ "$1" = "-r" ]; then
echo "Error: not an integer!" echo "Error: not an integer!"
resets="$2" resets="$2"
echo "Keeping value of" $resets echo "Keeping value of" $resets
fi norestart=1
else
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 echo $1 $resets $3 $4 $5
echo $1 $resets $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg echo $1 $resets $3 $4 $5 > /home/pi/CubeSatSim/sim.cfg
fi
if [ "$norestart" = "1" ]; then
echo
echo "no changes"
else
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
fi
elif [ "$1" = "-l" ]; then elif [ "$1" = "-l" ]; then
@ -331,11 +298,15 @@ elif [ "$1" = "-l" ]; then
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 echo $1 $2 $lat $long $5
echo $1 $2 $lat $long $5 > /home/pi/CubeSatSim/sim.cfg echo $1 $2 $lat $long $5 > /home/pi/CubeSatSim/sim.cfg
if [ "$norestart" = "1" ]; then
echo "no changes"
else
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
fi fi
fi
# sudo systemctl restart cubesatsim # sudo systemctl restart cubesatsim

Loading…
Cancel
Save

Powered by TurnKey Linux.