#!/usr/bin/env bash OS_DISTRO="$1" if [ -z "${OS_DISTRO}" ];then OS_DISTRO="generic" fi INSTANCE_ID="$( uuidgen |cut -d '-' -f 1 )" HOSTNAME="${OS_DISTRO}-${INSTANCE_ID}" cat meta-data | ruby replace.rb "##INSTANCE_ID##" "${INSTANCE_ID}" | ruby replace.rb "##HOSTNAME##" "${HOSTNAME}" > meta-data.in && \ cp -vf meta-data.in meta-data