-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker_entrypoint.sh
38 lines (28 loc) · 1.02 KB
/
docker_entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -e
export HOST_IP=$(ip -4 route list match 0/0 | awk '{print $3}')
export GATEWAY_CONFIG_PATH=/root
rm -rf /root/cl-external-* /root/lnd-external-*
echo start9/public >/root/.backupignore
echo start9/shared >>/root/.backupignore
result=$(yq '.nodes.[] | select(.connection-settings.type == "internal" and .type == "lnd")' /root/start9/config.yaml)
if [[ ! -z $result ]]; then
if ! test -d /mnt/lnd; then
echo "LND mountpoint does not exist"
exit 0
fi
while ! test -f /mnt/lnd/admin.macaroon; do
echo "Waiting for LND admin macaroon to be generated..."
sleep 30
done
# Create the directory structure for mainnet
mkdir -p /lnd_data/data/chain/bitcoin/mainnet
# Copy all macaroon files to the mainnet directory
cp /mnt/lnd/*.macaroon /lnd_data/data/chain/bitcoin/mainnet/
# Copy the TLS certificate
cp /mnt/lnd/tls.cert /lnd_data/tls.cert
fi
# Set LND address
export LND_ADDRESS='lnd.embassy'
export LND_IP=$(getent hosts $LND_ADDRESS | awk '{ print $1 }')
exec tini -g -- gatewayd lnd