From 087b2d38ef5caade173ea2416f6c16665fff1e90 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Mon, 21 Jan 2019 21:04:34 +0100 Subject: [PATCH] wait for macaroons creation --- home.admin/config.scripts/lnd.export.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/home.admin/config.scripts/lnd.export.sh b/home.admin/config.scripts/lnd.export.sh index 9895a8b..9d60de9 100644 --- a/home.admin/config.scripts/lnd.export.sh +++ b/home.admin/config.scripts/lnd.export.sh @@ -135,19 +135,20 @@ elif [ "${exportType}" = "reset" ]; then echo "" cd echo "- deleting old macaroons" + sudo rm /home/admin/.lnd/data/chain/${network}/${chain}net/*.macaroon sudo rm /home/bitcoin/.lnd/data/chain/${network}/${chain}net/*.macaroon sudo rm /home/bitcoin/.lnd/data/chain/${network}/${chain}net/macaroons.db echo "- resetting TLS cert" sudo /home/admin/config.scripts/lnd.newtlscert.sh - echo "- restarting LND ... wait 20 secs" + echo "- restarting LND ... wait 10 secs" sudo systemctl start lnd - sleep 20 + sleep 10 sudo -u bitcoin lncli unlock + echo "- creating new macaroons ... wait 10 secs" + sleep 10 echo "- copy new macaroons to admin user" sudo cp /home/bitcoin/.lnd/data/chain/${network}/${chain}net/*.macaroon /home/admin/.lnd/data/chain/${network}/${chain}net/ - sudo cp /home/bitcoin/.lnd/data/chain/${network}/${chain}net/macaroons.db /home/admin/.lnd/data/chain/${network}/${chain}net/ sudo chown admin:admin -R /home/admin/.lnd/data/chain/${network}/${chain}net/*.macaroon - sudo chown admin:admin /home/admin/.lnd/data/chain/${network}/${chain}net/macaroons.db echo "OK DONE" else