mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-27 15:04:04 +00:00
38 lines
1.1 KiB
Bash
Executable File
38 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
source /usr/share/mynode/mynode_config.sh
|
|
|
|
mkdir -p /home/admin/.lnd/
|
|
mkdir -p /home/admin/.lnd/data/chain/bitcoin/mainnet/
|
|
chown -R admin:admin /home/admin/.lnd/
|
|
|
|
echo "Waiting on lnd files..."
|
|
while [ ! -f $LND_TLS_CERT_FILE ]; do
|
|
sleep 1m
|
|
done
|
|
# Copy cert so we can interact with LND even if wallet has not been created
|
|
cp -f $LND_TLS_CERT_FILE /home/admin/.lnd/
|
|
chown -R admin:admin /home/admin/.lnd/
|
|
while [ ! -f $LND_ADMIN_MACAROON_FILE ]; do
|
|
sleep 1m
|
|
done
|
|
echo "LND files found!"
|
|
|
|
while true; do
|
|
# Make sure lnd path exists for admin user
|
|
mkdir -p /home/admin/.lnd/
|
|
mkdir -p /home/admin/.lnd/data/chain/bitcoin/mainnet/
|
|
chown -R admin:admin /home/admin/.lnd/
|
|
|
|
# Copy LND files to admin folder
|
|
cp -f $LND_TLS_CERT_FILE /home/admin/.lnd/
|
|
cp -f /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/*.macaroon /home/admin/.lnd/data/chain/bitcoin/mainnet/
|
|
chown -R admin:admin /home/admin/.lnd/
|
|
echo "Updated admin copy of LND files!"
|
|
|
|
# Wait for changes
|
|
inotifywait -e modify -e create -e delete $LND_TLS_CERT_FILE /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/*.macaroon
|
|
done
|
|
|
|
# Should never exit
|
|
exit 99 |