|
@ -51,6 +51,43 @@ if [ "${chain}" != "${choice}" ]; then |
|
|
else |
|
|
else |
|
|
echo "Testnet Setting changed .." |
|
|
echo "Testnet Setting changed .." |
|
|
sudo /home/admin/config.scripts/network.chain.sh ${choice}net |
|
|
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 |
|
|
needsReboot=1 |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|