From c8c5d7c64e1dcd5718b481f9a12c734ac7f1a22f Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Wed, 26 May 2021 10:27:47 -0400 Subject: [PATCH] added auto reset --- config.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/config.sh b/config.sh index adf5bca5..d786dcf9 100755 --- a/config.sh +++ b/config.sh @@ -23,7 +23,7 @@ read callsign if [ -z $callsign ] ; then callsign="$1" - echo $callsign + echo "Keeping value of" $callsign fi echo -e "Input reset count (integer): " @@ -32,13 +32,13 @@ read resets if [ -z $resets ] ; then resets="$2" - echo $resets + echo "Keeping value of" $resets fi if ! [[ $resets =~ ^[0-9]+$ ]] ; then echo "Error: not an integer!" resets="$2" - echo $resets + echo "Keeping value of" $resets fi echo -e "Input latitude (decimal degrees, positive is north): " @@ -48,13 +48,14 @@ read lat if [ -z $lat ] ; then lat="$3" - echo $lat + echo "Keeping value of" $lat fi if ! [[ $lat =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then echo "Error: not a number!" lat="$3" + echo "Keeping value of" $lat fi echo -e "Input longitude (decimal degrees, positive is east): " @@ -64,13 +65,14 @@ read long if [ -z $long ] ; then long="$4" - echo $long + echo "Keeping value of" $long fi if ! [[ $long =~ ^[+-]?[0-9]+([.][0-9]+)?$ ]] ; then echo "Error: not a number!" long="$4" + echo "Keeping value of" $long fi echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" @@ -78,4 +80,8 @@ echo -e "\nCubeSatSim configuraation sim.cfg file updated to: \n" echo $callsign $resets $lat $long echo $callsign $resets $lat $long > sim.cfg + +echo "Restarting CubeSatSim with new configuraation file" + +sudo systemctl restart cubesatsim