#1116 update to newest LND on importing rescue file

This commit is contained in:
rootzoll 2020-05-03 01:22:45 +02:00
parent 2f2f22ee15
commit 4dbecbf7a7

View File

@ -122,6 +122,7 @@ elif [ ${mode} = "restore" ]; then
filename=$(sudo ls /home/admin/lnd-rescue-*.tar.gz)
echo "OK -> found file to restore: ${filename}"
# checksum test
md5checksum=$(md5sum ${filename} | head -n1 | cut -d " " -f1)
isCorrect=$(echo ${filename} | grep -c ${md5checksum})
if [ ${isCorrect} -eq 1 ]; then
@ -132,6 +133,7 @@ elif [ ${mode} = "restore" ]; then
echo "Recommend to abort and upload again!"
fi
# overrride test
oldWalletExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${chain}net/wallet.db 2>/dev/null | grep -c "wallet.db")
if [ ${oldWalletExists} -gt 0 ]; then
echo
@ -166,6 +168,19 @@ elif [ ${mode} = "restore" ]; then
echo "OK"
echo
# check if LND needs update
# (if RaspiBlitz has an optional LND version update, then install it
# the newer LND version can always handle older data)
echo "Checking LND version ..."
source <(sudo -u admin /home/admin/config.scripts/lnd.update.sh info)
if [ ${lndUpdateInstalled} -eq 0 ]; then
echo "Installing available LND update ... (newer version can handle more wallet formats)"
sudo -u admin /home/admin/config.scripts/lnd.update.sh verified
else
echo "OK"
fi
echo
# start LND
echo "Starting lnd..."
sudo systemctl start lnd