diff --git a/home.admin/70initLND.sh b/home.admin/70initLND.sh index cee15dfd..0194b838 100755 --- a/home.admin/70initLND.sh +++ b/home.admin/70initLND.sh @@ -215,7 +215,9 @@ if [ ${walletExists} -eq 0 ]; then fi done - sudo sed -i "s/^setupStep=.*/setupStep=65/g" /home/admin/raspiblitz.info + if [ ${setupStep} -lt 100 ]; then + sudo sed -i "s/^setupStep=.*/setupStep=65/g" /home/admin/raspiblitz.info + fi else @@ -457,9 +459,21 @@ else fi echo "" -# set SetupState (scan is done - so its 80%) -sudo sed -i "s/^setupStep=.*/setupStep=80/g" /home/admin/raspiblitz.info +if [ ${setupStep} -lt 100 ]; then -###### finishSetup -sudo /home/admin/90finishSetup.sh -sudo /home/admin/95finalSetup.sh \ No newline at end of file + # set SetupState (scan is done - so its 80%) + sudo sed -i "s/^setupStep=.*/setupStep=80/g" /home/admin/raspiblitz.info + + ###### finishSetup + sudo /home/admin/90finishSetup.sh + sudo /home/admin/95finalSetup.sh + +else + + whiptail --title "RESET DONE" --msgbox " +OK LND Reset is done. +System will restart now. +" 10 35 + sudo shutdown -r now + +fi \ No newline at end of file diff --git a/home.admin/98repairMenu.sh b/home.admin/98repairMenu.sh index d542e2f1..0cda05e4 100755 --- a/home.admin/98repairMenu.sh +++ b/home.admin/98repairMenu.sh @@ -4,40 +4,15 @@ source /home/admin/raspiblitz.info source /mnt/hdd/raspiblitz.conf -# Basic Options -OPTIONS=(HARDWARE "Run Hardwaretest" \ - SOFTWARE "Run Softwaretest (DebugReport)" \ - BLOCKCHAIN "Delete Blockchain & Re-Download" \ - CLEANHDD "Delete Data - keep Blockchain" - ) +askBackupCopy() +{ + whiptail --title "LND Data Backup" --yes-button "Backup" --no-button "Skip" --yesno " +Before deleting your data, do you want +to make a backup of all your LND Data +and download that file to your laptop? -CHOICE=$(whiptail --clear --title "Repair Options" --menu "" 12 60 5 "${OPTIONS[@]}" 2>&1 >/dev/tty) - -clear -case $CHOICE in - HARDWARE) - sudo /home/admin/05hardwareTest.sh - /home/admin/00mainMenu.sh - ;; - SOFTWARE) - sudo /home/admin/XXdebugLogs.sh - echo "Press ENTER to return to main menu." - read key - /home/admin/00mainMenu.sh - ;; - BLOCKCHAIN) - /home/admin/XXcleanHDD.sh -blockchain - exit 1; - ;; - CLEANHDD) - - whiptail --title "LND Data Backup" --yes-button "Download Backup" --no-button "Skip" --yesno " -Before deleting your data on HDD, do you -want to make a backup of all your LND Data -and download that file to your laptop. - -Do you want to download LND Data Backup now? - " 12 58 +Download LND Data Backup now? + " 12 44 if [ $? -eq 0 ]; then clear echo "*************************************" @@ -58,8 +33,67 @@ Do you want to download LND Data Backup now? sleep 2 /home/admin/config.scripts/lnd.rescue.sh backup no-download fi +} +infoResetSDCard() +{ + whiptail --title "RESET DONE" --msgbox " +OK Reset of HDD is done. +System will now shutdown. + +To start fresh please write a fresh +RaspiBlitz image to your SD card. +" 12 40 +} + +# Basic Options +OPTIONS=(HARDWARE "Run Hardwaretest" \ + SOFTWARE "Run Softwaretest (DebugReport)" \ + RESET-CHAIN "Delete Blockchain & Re-Download" \ + RESET-LND "Delete LND & start new node/wallet" \ + RESET-HDD "Delete HDD Data but keep Blockchain" \ + RESET-ALL "Delete HDD completly to start fresh" + ) + +CHOICE=$(whiptail --clear --title "Repair Options" --menu "" 12 60 5 "${OPTIONS[@]}" 2>&1 >/dev/tty) + +clear +case $CHOICE in + HARDWARE) + sudo /home/admin/05hardwareTest.sh + /home/admin/00mainMenu.sh + ;; + SOFTWARE) + sudo /home/admin/XXdebugLogs.sh + echo "Press ENTER to return to main menu." + read key + /home/admin/00mainMenu.sh + ;; + RESET-CHAIN) + /home/admin/XXcleanHDD.sh -blockchain + /home/admin/98repairBlockchain.sh + echo "For reboot type: sudo shutdown -r now" + exit 1; + ;; + RESET-LND) + askBackupCopy + sudo systemctl stop lnd + sudo rm -r /mnt/hdd/lnd + /home/admin/70initLND.sh + exit 1; + ;; + RESET-HDD) + askBackupCopy /home/admin/XXcleanHDD.sh + infoResetSDCard + sudo shutdown now + exit 1; + ;; + RESET-ALL) + askBackupCopy + /home/admin/XXcleanHDD.sh -all + infoResetSDCard + sudo shutdown now exit 1; ;; esac