fix services during copy

This commit is contained in:
rootzoll 2020-06-17 22:52:43 +02:00
parent 430ec991b4
commit d32e110325

View file

@ -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