From 8167df5d5e27e9562fbc924f4d2e407093b24bc6 Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 20 Jun 2024 02:52:03 -0400 Subject: [PATCH] Update update changed reboot --- update | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/update b/update index 61e62873..685466d0 100755 --- a/update +++ b/update @@ -268,20 +268,26 @@ if [ $changed -eq 1 ]; then echo fi -if [ $FLAG -eq 1 ]; then - echo "systemctl daemon-reload and reboot" - sudo systemctl daemon-reload - sudo reboot -h now +if [ "$noreboot" = "0" ] ; then + + 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 + 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 + else + echo "nothing to do." + fi + fi +else + + echo "Reboot disabled" fi - - echo "CubeSatSim update complete." + +echo "CubeSatSim update complete."