From 284a035a526b2c29937bbde650674f1ed26a29ef Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 26 Jul 2020 03:00:21 +0200 Subject: [PATCH] debug migration --- home.admin/80scanLND.sh | 16 ++-------------- home.admin/config.scripts/blitz.migration.sh | 16 +++++++++++++++- home.admin/config.scripts/network.txindex.sh | 1 + 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/home.admin/80scanLND.sh b/home.admin/80scanLND.sh index 23b7b2f65..78e266b7e 100755 --- a/home.admin/80scanLND.sh +++ b/home.admin/80scanLND.sh @@ -84,24 +84,12 @@ if [ ${bitcoinActive} -eq 0 ] || [ ${#bitcoinErrorFull} -gt 0 ] || [ "${1}" == " echo fi + echo "POSSIBLE OPTIONS:" # check if maybe problems with txindex source <(/home/admin/config.scripts/network.txindex.sh status) if [ "${txindex}" == "1" ]; then - if [ "${indexFinished}" == "0" ]; then - # bitcoind is not starting while still building index - recommend turning off index and restart - whiptail --title "Problems with Bitcoin Index" --yes-button "TurnOff TxIndex" --no-button "Do Nothing" --yesno "It looks like ${network}d has problems building the txindex. Turning Off the txindex and restart is recommended." 10 60 - if [ $? -eq 0 ]; then - # delete txindex, turn off and deactivate apps needed index - sudo /home/admin/config.scripts/network.txindex.sh delete - whiptail --msgbox "OK txindex was turned off.\n\nTo be able to build a valid txindex in the future you might need to reset/redownload the blockchain." 10 56 "" --title " TXINDEX OFF " - /home/admin/XXshutdown.sh reboot - fi - else - # bitcoind is not starting but index was build in the past - recommend repair with turning off index - echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index." - fi + echo "-> Use command 'repair' and then choose 'DELETE-INDEX' to try rebuilding transaction index." fi - echo "-> Use command 'repair' and then choose 'RESET-CHAIN' to try downloading new blockchain." echo "-> Use command 'debug' for more log output you can use for getting support." echo "-> Use command 'menu' to open main menu." diff --git a/home.admin/config.scripts/blitz.migration.sh b/home.admin/config.scripts/blitz.migration.sh index 95b3272ad..6a93a250c 100644 --- a/home.admin/config.scripts/blitz.migration.sh +++ b/home.admin/config.scripts/blitz.migration.sh @@ -151,6 +151,8 @@ if [ "$1" = "export-gui" ]; then echo "To complete the data migration follow then instructions on the github FAQ." echo read key + echo "Shutting down ...." + sleep 4 /home/admin/XXshutdown.sh exit 0 fi @@ -257,7 +259,7 @@ if [ "$1" = "import-gui" ]; then # make sure HDD/SSD is not mounted # because importing migration just works during early setup if [ ${isMounted} -eq 1 ]; then - echo "FAIL --> cannot import migration data when HDD(SDD is mounted" + echo "FAIL --> cannot import migration data when HDD/SSD is mounted" exit 1 fi @@ -273,10 +275,18 @@ if [ "$1" = "import-gui" ]; then exit 1 fi + + # ask format for new HDD/SSD OPTIONS=(EXT4 "Ext4 & 1 Partition (default)" \ BTRFS "BTRFS & 3 Partitions (experimental)" ) + + # check if HDD/SSD contains Bitcoin Blockchain + if [ "${hddBlocksBitcoin}" == "1" ]; then + OPTIONS+=(CLEAN "Just clean HDD & use Blockchain") + fi + CHOICE=$(whiptail --clear --title "Formatting ${hddCandidate}" --menu "" 9 52 2 "${OPTIONS[@]}" 2>&1 >/dev/tty) clear case $CHOICE in @@ -296,6 +306,10 @@ if [ "$1" = "import-gui" ]; then exit 1 fi ;; + CLEAN) + echo "CLEAN HDD & Keep Blockchain" + sudo /home/admin/XXcleanHDD.sh + ;; *) echo "CANCEL" exit 0 diff --git a/home.admin/config.scripts/network.txindex.sh b/home.admin/config.scripts/network.txindex.sh index 8bd5ed37b..88d74613f 100644 --- a/home.admin/config.scripts/network.txindex.sh +++ b/home.admin/config.scripts/network.txindex.sh @@ -102,6 +102,7 @@ if [ "$1" = "delete" ]; then sudo sed -i "s/^txindex=.*/txindex=0/g" /mnt/hdd/${network}/${network}.conf echo "# deleting tx index ..." sudo rm -r /mnt/hdd/${network}/indexes/txindex + echo "# restarting bitcoind ..." sudo systemctl restart ${network}d exit 0 fi