From 3ce0effb21f733f5a8b364c302d05f946e468ce9 Mon Sep 17 00:00:00 2001 From: kant777 <61204489+kant777@users.noreply.github.com> Date: Sat, 13 Jan 2024 03:40:59 -0800 Subject: [PATCH] Update entrypoint.sh --- geth-poa/entrypoint.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/geth-poa/entrypoint.sh b/geth-poa/entrypoint.sh index b7bc421d5bf4..ec53ef27123a 100644 --- a/geth-poa/entrypoint.sh +++ b/geth-poa/entrypoint.sh @@ -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" + +PUBLIC_NODE_IP=${PUBLIC_NODE_IP:-""} +echo "EXTERNAL_NODE_IP is set to: $PUBLIC_NODE_IP" -if [ -n "${PUBLIC_NODE_IP:-}" ]; then +# 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"