From a18f53b9725234bccf9450aa6e51b0c2a282405d Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 27 Jul 2023 09:53:02 -0400 Subject: [PATCH] update reboots instead of restarts --- update | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/update b/update index 53aa19cd..cc35aa01 100755 --- a/update +++ b/update @@ -64,20 +64,6 @@ if [[ $(grep 'update' /home/pi/CubeSatSim/.updated) ]]; then /home/pi/CubeSatSim/update fi -if [ $FLAG -eq 1 ]; then - echo "systemctl daemon-reload and restart" - sudo systemctl daemon-reload - sudo systemctl restart cubesatsim -else - grep 'changed' /home/pi/CubeSatSim/.updated - if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then - echo "systemctl restart cubesatsim" - sudo systemctl restart cubesatsim - else - echo "nothing to do." - fi -fi - if [ ! -d "/home/pi/PiSSTVpp" ]; then sudo apt-get update && sudo apt-get dist-upgrade -y @@ -155,5 +141,21 @@ git pull > .updated_p else echo "nothing to do for pi-power-button." fi + +if [ $FLAG -eq 1 ]; then + echo "systemctl daemon-reload and reboot" + sudo systemctl daemon-reload + sudo reboot -h now +# sudo systemctl restart cubesatsim +else + grep 'changed' /home/pi/CubeSatSim/.updated + if [[ $(grep 'changed' /home/pi/CubeSatSim/.updated) ]]; then + echo "reboot" + sudo reboot -h now +# sudo systemctl restart cubesatsim + else + echo "nothing to do." + fi +fi echo "CubeSatSim update complete."