mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-08-08 17:23:35 +02:00
fix services during copy
This commit is contained in:
@@ -51,15 +51,6 @@ copyHost()
|
|||||||
clear
|
clear
|
||||||
echo
|
echo
|
||||||
echo "# *** Copy Blockchain Source Modus ***"
|
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 ..."
|
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)
|
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"
|
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
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "# install dependencies ..."
|
||||||
|
sudo apt-get install -y sshpass
|
||||||
|
|
||||||
echo "# get Password of RaspiBlitz to copy to ..."
|
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)
|
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
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "# stopping servives ..."
|
||||||
|
sudo systemctl stop lnd
|
||||||
|
sudo systemctl stop ${network}d
|
||||||
|
sudo systemctl disable ${network}d
|
||||||
|
cd /mnt/hdd/${network}
|
||||||
|
|
||||||
clear
|
clear
|
||||||
echo
|
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
|
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 ..."
|
echo "# start servives again ..."
|
||||||
sudo systemctl enable ${network}d
|
sudo systemctl enable ${network}d
|
||||||
|
Reference in New Issue
Block a user