mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-10 04:43:10 +02:00
cancel/shutdown
This commit is contained in:
@@ -44,7 +44,7 @@ migrationVersion="$2"
|
|||||||
if [ "${migrationOS}" == "raspiblitz" ]; then
|
if [ "${migrationOS}" == "raspiblitz" ]; then
|
||||||
|
|
||||||
# infodialog
|
# infodialog
|
||||||
whiptail --title " IMPORT MIGRATION FILE " --yes-button "Upload File" --no-button "Shutdown" --yesno "RaspiBlitz found data from UMBREL
|
whiptail --title " IMPORT MIGRATION FILE " --yes-button "Upload File" --no-button "Cancel/Shutdown" --yesno "RaspiBlitz found data from UMBREL
|
||||||
|
|
||||||
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ fi
|
|||||||
if [ "${migrationOS}" == "umbrel" ]; then
|
if [ "${migrationOS}" == "umbrel" ]; then
|
||||||
|
|
||||||
# infodialog
|
# infodialog
|
||||||
whiptail --title " UMBREL --> RASPIBLITZ " --yes-button "Start Migration" --no-button "Shutdown" --yesno "RaspiBlitz found data from UMBREL
|
whiptail --title " UMBREL --> RASPIBLITZ " --yes-button "Start Migration" --no-button "Cancel/Shutdown" --yesno "RaspiBlitz found data from UMBREL
|
||||||
|
|
||||||
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
||||||
|
|
||||||
@@ -164,7 +164,7 @@ fi
|
|||||||
if [ "${migrationOS}" == "mynode" ]; then
|
if [ "${migrationOS}" == "mynode" ]; then
|
||||||
|
|
||||||
# infodialog
|
# infodialog
|
||||||
whiptail --title " MYNODE --> RASPIBLITZ " --yes-button "Start Migration" --no-button "Shutdown" --yesno "RaspiBlitz found data from MYNODE
|
whiptail --title " MYNODE --> RASPIBLITZ " --yes-button "Start Migration" --no-button "Cancel/Shutdown" --yesno "RaspiBlitz found data from MYNODE
|
||||||
|
|
||||||
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
You can migrate your blockchain & LND data (funds & channels) over to RaspiBlitz.
|
||||||
|
|
||||||
|
@@ -2,10 +2,10 @@
|
|||||||
_temp=$(mktemp -p /dev/shm/)
|
_temp=$(mktemp -p /dev/shm/)
|
||||||
|
|
||||||
## get basic info
|
## get basic info
|
||||||
INFOFILE
|
|
||||||
source /home/admin/raspiblitz.info
|
source /home/admin/raspiblitz.info
|
||||||
|
|
||||||
# CHECK BASICS HDD info and react to no or too small HDD
|
# set place where zipped TAR file gets stored on migration dialog
|
||||||
|
defaultZipPath="/mnt/hdd/temp"
|
||||||
|
|
||||||
# prepare the config file (what will later become the raspiblitz.config)
|
# prepare the config file (what will later become the raspiblitz.config)
|
||||||
source /home/admin/_version.info
|
source /home/admin/_version.info
|
||||||
@@ -34,7 +34,7 @@ CHOICE=$(dialog --clear \
|
|||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
clear
|
clear
|
||||||
network=""
|
network=""
|
||||||
migration="raspiblitz"
|
migration=""
|
||||||
case $CHOICE in
|
case $CHOICE in
|
||||||
CLOSE)
|
CLOSE)
|
||||||
# TODO: check if case every comes up
|
# TODO: check if case every comes up
|
||||||
@@ -50,31 +50,77 @@ case $CHOICE in
|
|||||||
echo "network=litecoin" >> $CONFIGFILE
|
echo "network=litecoin" >> $CONFIGFILE
|
||||||
;;
|
;;
|
||||||
MIGRATION)
|
MIGRATION)
|
||||||
migration=raspiblitz
|
migration="raspiblitz"
|
||||||
echo "migration=raspiblitz" >> $SETUPFILE
|
echo "migration=raspiblitz" >> $SETUPFILE
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# IMPORT MIGRATION DIALOG
|
||||||
|
# if fails then restart the complete provision dialog
|
||||||
if [ "${migration}" == "raspiblitz" ]; then
|
if [ "${migration}" == "raspiblitz" ]; then
|
||||||
|
|
||||||
|
# make sure that temp directory exists and can be written by admin
|
||||||
|
sudo mkdir -p ${defaultZipPath}
|
||||||
|
sudo chmod 777 -R ${defaultZipPath}
|
||||||
|
|
||||||
|
clear
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
sudo /home/admin/config.scripts/blitz.migration.sh "import-gui"
|
|
||||||
# on error clean & repeat
|
|
||||||
if [ "$?" = "1" ]; then
|
|
||||||
echo
|
echo
|
||||||
echo "# clean and unmount for next try"
|
echo "*****************************"
|
||||||
sudo rm -f ${defaultZipPath}/raspiblitz-*.tar.gz 2>/dev/null
|
echo "* UPLOAD THE MIGRATION FILE *"
|
||||||
sudo umount /mnt/hdd 2>/dev/null
|
echo "*****************************"
|
||||||
sudo umount /mnt/storage 2>/dev/null
|
echo "If you have a migration file on your laptop you can now"
|
||||||
sudo umount /mnt/temp 2>/dev/null
|
echo "upload it and restore on the new HDD/SSD."
|
||||||
sleep 2
|
echo
|
||||||
/home/admin/00raspiblitz.sh
|
echo "ON YOUR LAPTOP open a new terminal and change into"
|
||||||
|
echo "the directory where your migration file is and"
|
||||||
|
echo "COPY, PASTE AND EXECUTE THE FOLLOWING COMMAND:"
|
||||||
|
echo "scp -r ./raspiblitz-*.tar.gz admin@${localip}:${defaultZipPath}"
|
||||||
|
echo ""
|
||||||
|
echo "Use password 'raspiblitz' to authenticate file transfer."
|
||||||
|
echo "PRESS ENTER when upload is done."
|
||||||
|
read key
|
||||||
|
|
||||||
|
countZips=$(sudo ls ${defaultZipPath}/raspiblitz-*.tar.gz 2>/dev/null | grep -c 'raspiblitz-')
|
||||||
|
|
||||||
|
# in case no upload found
|
||||||
|
if [ ${countZips} -eq 0 ]; then
|
||||||
|
echo
|
||||||
|
echo "FAIL: Was not able to detect uploaded file in ${defaultZipPath}"
|
||||||
|
echo "error='no file found'"
|
||||||
|
sleep 3
|
||||||
|
/home/admin/00provisionDialog.sh
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# in case of multiple files
|
||||||
|
if [ ${countZips} -gt 1 ]; then
|
||||||
|
echo
|
||||||
|
echo "# FAIL: Multiple possible files detected in ${defaultZipPath}"
|
||||||
|
echo "error='multiple files'"
|
||||||
|
sleep 3
|
||||||
|
/home/admin/00provisionDialog.sh
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# unzip migration file and check
|
||||||
|
echo
|
||||||
|
echo "OK: Upload found in ${defaultZipPath} - restoring data ... (please wait)"
|
||||||
|
source <(sudo /home/admin/config.scripts/blitz.migration.sh "import")
|
||||||
|
if [ ${#error} -gt 0 ]; then
|
||||||
|
echo
|
||||||
|
echo "# FAIL: Was not able to restore data"
|
||||||
|
echo "error='${error}'"
|
||||||
|
sleep 3
|
||||||
|
/home/admin/00provisionDialog.sh
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "OK: Migration data was imported - will now recover/restore RaspiBlitz with this data"
|
||||||
|
echo "PRESS ENTER TO CONTINUE"
|
||||||
|
read key
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
|
|
||||||
|
|
||||||
###################
|
###################
|
||||||
|
Reference in New Issue
Block a user