From 4388da48595f1feceb5ca13cba1a3697496e2639 Mon Sep 17 00:00:00 2001 From: openoms <43343391+openoms@users.noreply.github.com> Date: Sun, 9 Jun 2024 19:58:54 +0200 Subject: [PATCH] ask before reboot in UPDATE menu (#4606) * ask before reboot in UPDATE menu * correct comments --- home.admin/99updateMenu.sh | 115 +++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 5 deletions(-) diff --git a/home.admin/99updateMenu.sh b/home.admin/99updateMenu.sh index 149159954..4cdbb3b36 100755 --- a/home.admin/99updateMenu.sh +++ b/home.admin/99updateMenu.sh @@ -269,7 +269,28 @@ Do you really want to update LND now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 else - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " LND update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK LND update is done. + +By default a reboot is advised to sync macaroons and the TLS certificate. +Consider rebooting later manually if encountering any problems. + " 12 50 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the lnd.service .." + sudo systemctl start lnd + exit 0 + fi sleep 8 fi ;; @@ -293,7 +314,28 @@ Do you really want to update LND now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 else - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " LND update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK LND update is done. + +By default a reboot is advised to sync macaroons and the TLS certificate. +Consider rebooting later manually if encountering any problems. + " 12 50 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the lnd.service .." + sudo systemctl start lnd + exit 0 + fi sleep 8 fi ;; @@ -418,7 +460,28 @@ Do you really want to update Bitcoin Core now? error="" warn="" sudo -u admin /home/admin/config.scripts/bitcoin.update.sh tested - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; RECKLESS) whiptail --title "UNTESTED Bitcoin Core update to ${bitcoinLatestVersion}" --yes-button "Cancel" \ @@ -439,11 +502,53 @@ Do you really want to update Bitcoin Core now? if [ ${#error} -gt 0 ]; then whiptail --title "ERROR" --msgbox "${error}" 8 30 fi - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; CUSTOM) sudo -u admin /home/admin/config.scripts/bitcoin.update.sh custom - sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + whiptail \ + --title " Bitcoin Core update " \ + --yes-button "Reboot" \ + --no-button "Skip Reboot" \ + --yesno \ +"OK Bitcoin Core update is done. + +By default a reboot is advised. + " 9 40 + if [ $? -eq 0 ]; then + clear + echo "# REBOOT .." + sudo /home/admin/config.scripts/blitz.shutdown.sh reboot + sleep 8 + exit 1 + else + echo "# SKIP REBOOT" + echo "# starting the bitcoind.service .." + sudo systemctl start bitcoind + exit 0 + fi + sleep 8 ;; esac }