From d32e110325379faad8df7702b76c3ac526ff941c Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 17 Jun 2020 22:52:43 +0200 Subject: [PATCH] fix services during copy --- home.admin/98repairMenu.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/home.admin/98repairMenu.sh b/home.admin/98repairMenu.sh index 1ce2d214f..446af57d2 100755 --- a/home.admin/98repairMenu.sh +++ b/home.admin/98repairMenu.sh @@ -51,15 +51,6 @@ copyHost() clear echo echo "# *** Copy Blockchain Source Modus ***" - sed -i "s/^state=.*/state=copysource/g" /home/admin/raspiblitz.info - echo "# stopping servives ..." - sudo systemctl stop lnd - sudo systemctl stop ${network}d - sudo systemctl disable ${network}d - cd /mnt/hdd/${network} - - echo "# install dependencies ..." - sudo apt-get install -y sshpass echo "# get IP of RaspiBlitz to copy to ..." targetIP=$(whiptail --inputbox "\nPlease enter the LOCAL IP of the\nRaspiBlitz to copy Blockchain to:" 10 38 "" --title " Target IP " --backtitle "RaspiBlitz - Copy Blockchain" 3>&1 1>&2 2>&3) @@ -77,6 +68,9 @@ copyHost() whiptail --msgbox "Was not able to contact/ping: ${targetIP}\n\n- check if IP of target RaspiBlitz is correct.\n- check to be on the same local network.\n- try again ..." 11 58 "" --title " Testing Target IP " --backtitle "RaspiBlitz - Copy Blockchain" return fi + + echo "# install dependencies ..." + sudo apt-get install -y sshpass echo "# get Password of RaspiBlitz to copy to ..." targetPassword=$(whiptail --passwordbox "\nPlease enter the PASSWORD A of the\nRaspiBlitz to copy Blockchain to:" 10 38 "" --title "Target Password" --backtitle "RaspiBlitz - Copy Blockchain" 3>&1 1>&2 2>&3) @@ -89,10 +83,18 @@ copyHost() return fi + echo "# stopping servives ..." + sudo systemctl stop lnd + sudo systemctl stop ${network}d + sudo systemctl disable ${network}d + cd /mnt/hdd/${network} + clear echo - echo "# Starting copy over LAN (around 4 hours) ..." + echo "# Starting copy over LAN (around 4-6 hours) ..." + sed -i "s/^state=.*/state=copysource/g" /home/admin/raspiblitz.info sudo sshpass -p "${targetPassword}" rsync -avhW -e 'ssh -o StrictHostKeyChecking=no -p 22' --info=progress2 ./chainstate ./blocks bitcoin@${targetIP}:/mnt/hdd/bitcoin + sed -i "s/^state=.*/state=/g" /home/admin/raspiblitz.info echo "# start servives again ..." sudo systemctl enable ${network}d