fix(devops): Fix shellcheck errors for docker-init.sh script (#3265)

This commit is contained in:
Jamil
2024-01-16 12:05:40 -08:00
committed by GitHub
parent 856f72cd4b
commit 9d476d83e4

View File

@@ -16,15 +16,17 @@ fi
if [ "${LISTEN_ADDRESS_DISCOVERY_METHOD}" = "gce_metadata" ]; then
echo "Using GCE metadata to discover listen address"
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)
if [ "${PUBLIC_IP4_ADDR}" = "" ]; then
public_ip4=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" -H "Metadata-Flavor: Google" -s)
export PUBLIC_IP4_ADDR="${public_ip4}"
echo "Discovered PUBLIC_IP4_ADDR: ${PUBLIC_IP4_ADDR}"
fi
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)
if [ "${PUBLIC_IP6_ADDR}" = "" ]; then
public_ip6=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/ipv6s" -H "Metadata-Flavor: Google" -s)
export PUBLIC_IP6_ADDR="${public_ip6}"
echo "Discovered PUBLIC_IP6_ADDR: ${PUBLIC_IP6_ADDR}"
fi
fi
exec $@
exec "$@"