diff --git a/rust/docker-init.sh b/rust/docker-init.sh index d18149099..109ac5978 100755 --- a/rust/docker-init.sh +++ b/rust/docker-init.sh @@ -16,12 +16,12 @@ fi if [ "${LISTEN_ADDRESS_DISCOVERY_METHOD}" = "gce_metadata" ]; then echo "Using GCE metadata to discover listen address" - if [ "${PUBLIC_IP4_ADDR:-}" == "" ]; then + if [ "${PUBLIC_IP4_ADDR}" == "" ]; then export PUBLIC_IP4_ADDR=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google" -s) echo "Discovered PUBLIC_IP4_ADDR: ${PUBLIC_IP4_ADDR}" fi - if [ "${PUBLIC_IP6_ADDR:-}" == "" ]; then + if [ "${PUBLIC_IP6_ADDR}" == "" ]; then export PUBLIC_IP6_ADDR=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ipv6s" -H "Metadata-Flavor: Google" -s) echo "Discovered PUBLIC_IP6_ADDR: ${PUBLIC_IP6_ADDR}" fi