Browse Source

create wallet when changing to testnet #190

#146
rootzoll 6 years ago
parent
commit
50df38f9f9
  1. 37
      home.admin/00settingsMenuServices.sh
  2. 2
      home.admin/70initLND.sh

37
home.admin/00settingsMenuServices.sh

@ -51,6 +51,43 @@ if [ "${chain}" != "${choice}" ]; then
else
echo "Testnet Setting changed .."
sudo /home/admin/config.scripts/network.chain.sh ${choice}net
walletExists=$(sudo ls /mnt/hdd/lnd/data/chain/${network}/${choice}net/wallet.db | grep -c 'wallet.db')
if [ ${walletExists} -eq 0 ]; then
echo "Creating new Wallet"
sudo systemctl start lnd
tryAgain=1
while [ ${tryAgain} -eq 1 ]
do
echo "****************************************************************************"
echo "Creating a new LND Wallet for ${network}/${choice}net"
echo "****************************************************************************"
echo "A) For 'Wallet Password' use your PASSWORD C --> !! minimum 8 characters !!"
echo "B) Answere 'n' because you dont have a 'cipher seed mnemonic' (24 words) yet"
echo "C) For 'passphrase' to encrypt your 'cipher seed' use PASSWORD D (optional)"
echo "****************************************************************************"
lncli create
sudo -u bitcoin /usr/local/bin/lncli --chain=${network} create 2>error.out
error=`sudo cat error.out`
if [ ${#error} -eq 0 ]; then
# WIN
tryAgain=0
echo "!!! Make sure to write down the 24 words (cipher seed mnemonic) !!!"
echo "If you are ready. Press ENTER."
else
# FAIL
tryAgain=1
echo "!!! FAIL ---> SOMETHING WENT WRONG !!!"
echo "${error}"
echo "Press ENTER to retry ... or CTRL-c to EXIT"
fi
read key
done
sudo systemctl stop lnd
fi
echo "Update Admin Macaroon"
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 chown -R admin:admin /home/admin/.lnd/
needsReboot=1
fi
else

2
home.admin/70initLND.sh

@ -184,7 +184,7 @@ if [ ${macaroonExists} -eq 0 ]; then
sudo mkdir /home/admin/.lnd/data
sudo mkdir /home/admin/.lnd/data/chain
sudo mkdir /home/admin/.lnd/data/chain/${network}
sudo mkdir /home/admin/.lnd//data/chain/${network}/${chain}net
sudo mkdir /home/admin/.lnd/data/chain/${network}/${chain}net
sudo cp /home/bitcoin/.lnd/tls.cert /home/admin/.lnd
sudo cp /home/bitcoin/.lnd/lnd.conf /home/admin/.lnd
sudo cp /home/bitcoin/.lnd/data/chain/${network}/${chain}net/admin.macaroon /home/admin/.lnd/data/chain/${network}/${chain}net

Loading…
Cancel
Save