Skip to content

Instantly share code, notes, and snippets.

@smant
Last active December 5, 2017 14:57
Show Gist options
  • Save smant/cd88ba75502dc68bfd3f07c700cc6845 to your computer and use it in GitHub Desktop.
Save smant/cd88ba75502dc68bfd3f07c700cc6845 to your computer and use it in GitHub Desktop.
aws ecs
#!/bin/sh
if [ "$AWS" != "" ] ; then
if which curl 1>/dev/null; then
AWS_EC2_LOCAL_IPV4=`curl --connect-timeout=1 http://169.254.169.254/latest/meta-data/local-ipv4 2>/dev/null`
else
if which wget 1>/dev/null; then
AWS_EC2_LOCAL_IPV4=`wget -q -O - http://169.254.169.254/latest/meta-data/local-ipv4`
fi
fi
export AWS_EC2_LOCAL_IPV4=$AWS_EC2_LOCAL_IPV4
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment