Skip to content

Commit

Permalink
chore: add error handling to entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ngutech21 committed Dec 16, 2023
1 parent 4937bb2 commit 3f84c85
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,21 @@
# Decode the base64 environment variables and write them to files
mkdir -p /lndconf
echo "$LND_MACAROON_BASE64" | base64 -d > /lndconf/admin.macaroon
if [ $? -ne 0 ]; then
echo "LND_MACAROON_BASE64 is not valid base64"
exit 1
fi

echo "$LND_TLS_CERT_BASE64" | base64 -d > /lndconf/tls.cert
if [ $? -ne 0 ]; then
echo "LND_TLS_CERT_BASE64 is not valid base64"
exit 1
fi

# Restrict permissions of the files
chmod 700 /lndconf
chmod 400 /lndconf/admin.macaroon
chmod 400 /lndconf/tls.cert

# Start your application
exec "$@"

0 comments on commit 3f84c85

Please sign in to comment.