robosats/docker/lnd/entrypoint.sh

19 lines
376 B
Bash
Raw Permalink Normal View History

2022-02-09 15:21:51 +00:00
#!/bin/sh
set -e
# Create lnd.conf if it doesn't exist
if [ ! -f "/home/lnd/.lnd/lnd.conf" ]; then
envsubst < /tmp/lnd.conf > /home/lnd/.lnd/lnd.conf
fi
# Change local user id and group
usermod -u "${LOCAL_USER_ID:?}" lnd
groupmod -g "${LOCAL_GROUP_ID:?}" lnd
# Fix ownership
chown -R lnd /home/lnd
2022-02-09 20:51:05 +00:00
echo ${AUTO_UNLOCK_PWD} > /tmp/pwd
2022-02-09 15:21:51 +00:00
# Start lnd
exec sudo -u lnd "$@"