2019-06-15 23:02:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
source /usr/share/mynode/mynode_config.sh
|
|
|
|
|
|
|
|
mkdir -p /tmp/mynode_lndconnect/
|
|
|
|
cd /tmp/mynode_lndconnect/
|
|
|
|
|
|
|
|
echo "Starting lndconnect script..."
|
|
|
|
|
|
|
|
echo "Waiting on lnd wallet file..."
|
|
|
|
while [ ! -f $LND_WALLET_FILE ]; do
|
|
|
|
sleep 1m
|
|
|
|
done
|
|
|
|
echo "LND Wallet found!"
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
echo "Generating lndconnect QR codes..."
|
|
|
|
rm -rf /tmp/mynode_lndconnect/*
|
|
|
|
|
|
|
|
# Generate QR Codes
|
2019-07-13 23:56:42 +00:00
|
|
|
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet
|
|
|
|
#cp -f lndconnect-qr.png lndconnect_remote_grpc.png
|
2019-06-15 23:02:44 +00:00
|
|
|
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip
|
|
|
|
cp -f lndconnect-qr.png lndconnect_local_grpc.png
|
2019-07-13 23:56:42 +00:00
|
|
|
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet -p 10080
|
|
|
|
#cp -f lndconnect-qr.png lndconnect_remote_rest.png
|
2019-06-15 23:02:44 +00:00
|
|
|
lndconnect --lnddir=/mnt/hdd/mynode/lnd -o --bitcoin.mainnet --localip -p 10080
|
|
|
|
cp -f lndconnect-qr.png lndconnect_local_rest.png
|
|
|
|
|
|
|
|
# Generate Text Files
|
2019-07-13 23:56:42 +00:00
|
|
|
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet > lndconnect_remote_grpc.txt
|
2019-06-15 23:02:44 +00:00
|
|
|
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --localip > lndconnect_local_grpc.txt
|
2019-07-13 23:56:42 +00:00
|
|
|
#lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet -p 10080 > lndconnect_remote_rest.txt
|
2019-06-15 23:02:44 +00:00
|
|
|
lndconnect --lnddir=/mnt/hdd/mynode/lnd -j --bitcoin.mainnet --localip -p 10080 > lndconnect_local_rest.txt
|
|
|
|
|
|
|
|
echo "Done! Waiting until LND changes, then regen lndconnect codes!"
|
|
|
|
inotifywait -e modify -e create -e delete $LND_ADMIN_MACAROON_FILE
|
|
|
|
done
|
|
|
|
|
|
|
|
# Should never exit
|
|
|
|
exit 99
|