Browse Source

macaroon check

#146
rootzoll 6 years ago
parent
commit
ba5d7e1d16
  1. 20
      home.admin/00settingsMenuServices.sh

20
home.admin/00settingsMenuServices.sh

@ -68,10 +68,20 @@ if [ "${chain}" != "${choice}" ]; then
sudo -u bitcoin /usr/local/bin/lncli --chain=${network} create 2>error.out sudo -u bitcoin /usr/local/bin/lncli --chain=${network} create 2>error.out
error=`sudo cat error.out` error=`sudo cat error.out`
if [ ${#error} -eq 0 ]; then if [ ${#error} -eq 0 ]; then
# WIN sleep 2
tryAgain=0 macaroonExists=$(sudo ls /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon | grep -c 'admin.macaroon')
echo "!!! Make sure to write down the 24 words (cipher seed mnemonic) !!!" if [ ${macaroonExists} -eq 1 ]; then
echo "If you are ready. Press ENTER." # WIN
tryAgain=0
echo "!!! Make sure to write down the 24 words (cipher seed mnemonic) !!!"
echo "If you are ready. Press ENTER."
else
# FAIL - no macaroon
tryAgain=1
echo "!!! FAIL ---> No macaroon found:"
echo "/home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon"
echo "Press ENTER to retry ... or CTRL-c to EXIT"
fi
else else
# FAIL # FAIL
tryAgain=1 tryAgain=1
@ -86,7 +96,7 @@ if [ "${chain}" != "${choice}" ]; then
sudo systemctl stop lnd sudo systemctl stop lnd
fi fi
echo "Update Admin Macaroon" echo "Update Admin Macaroon"
sudo rm -r /home/admin/.lnd/data/chain/${network}/${choice}net sudo rm -r /home/admin/.lnd/data/chain/${network}/${choice}net 2>/dev/null
sudo mkdir /home/admin/.lnd/data/chain/${network}/${choice}net sudo mkdir /home/admin/.lnd/data/chain/${network}/${choice}net
sudo cp /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon /home/admin/.lnd/data/chain/${network}/${choice}net sudo cp /home/bitcoin/.lnd/data/chain/${network}/${choice}net/admin.macaroon /home/admin/.lnd/data/chain/${network}/${choice}net
sudo chown -R admin:admin /home/admin/.lnd/ sudo chown -R admin:admin /home/admin/.lnd/

Loading…
Cancel
Save