Skip to content

Commit 3ce0eff

Browse files
authored
Update entrypoint.sh
1 parent e75c17b commit 3ce0eff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

geth-poa/entrypoint.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,19 @@ fi
4343

4444
# Obtain assigned container IP for p2p
4545
NODE_IP=${NODE_IP:-$(hostname -i)}
46+
echo "NODE_IP is set to: $NODE_IP"
47+
48+
PUBLIC_NODE_IP=${PUBLIC_NODE_IP:-""}
49+
echo "EXTERNAL_NODE_IP is set to: $PUBLIC_NODE_IP"
4650

47-
if [ -n "${PUBLIC_NODE_IP:-}" ]; then
51+
# Set NAT_FLAG based on whether PUBLIC_NODE_IP is empty or not
52+
if [ -n "$PUBLIC_NODE_IP" ]; then
4853
NAT_FLAG="--nat=extip:$PUBLIC_NODE_IP"
4954
else
5055
NAT_FLAG="--nat=none"
5156
fi
5257

53-
5458
# (Optional) Echo the values for verification
55-
echo "NODE_IP is set to: $NODE_IP"
56-
echo "EXTERNAL_NODE_IP is set to: $PUBLIC_NODE_IP"
5759

5860
if [ "$GETH_NODE_TYPE" = "bootnode" ]; then
5961
echo "Starting bootnode"

0 commit comments

Comments
 (0)