Update entrypoint.sh

This commit is contained in:
kant777 2024-01-13 03:40:59 -08:00 committed by GitHub
parent e75c17b642
commit 3ce0effb21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,17 +43,19 @@ fi
# Obtain assigned container IP for p2p
NODE_IP=${NODE_IP:-$(hostname -i)}
echo "NODE_IP is set to: $NODE_IP"
if [ -n "${PUBLIC_NODE_IP:-}" ]; then
PUBLIC_NODE_IP=${PUBLIC_NODE_IP:-""}
echo "EXTERNAL_NODE_IP is set to: $PUBLIC_NODE_IP"
# Set NAT_FLAG based on whether PUBLIC_NODE_IP is empty or not
if [ -n "$PUBLIC_NODE_IP" ]; then
NAT_FLAG="--nat=extip:$PUBLIC_NODE_IP"
else
NAT_FLAG="--nat=none"
fi
# (Optional) Echo the values for verification
echo "NODE_IP is set to: $NODE_IP"
echo "EXTERNAL_NODE_IP is set to: $PUBLIC_NODE_IP"
if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
echo "Starting bootnode"