Skip to content

Instantly share code, notes, and snippets.

@rosy1280
Last active September 5, 2015 03:54
Show Gist options
  • Save rosy1280/431789 to your computer and use it in GitHub Desktop.
Save rosy1280/431789 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
###############################
# get the hostname from ec2 #
###############################
HOST=`ec2-get-info --public-hostname | cut -d":" -f2`
#
###############################
# echo the hostname out #
###############################
echo ${HOST}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment