2023-11-14 21:52:09 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
OS_DISTRO="$1"
|
|
|
|
|
|
|
|
if [ -z "${OS_DISTRO}" ];then
|
|
|
|
OS_DISTRO="generic"
|
|
|
|
fi
|
|
|
|
|
|
|
|
INSTANCE_ID="$( uuidgen |cut -d '-' -f 1 )"
|
2023-11-14 22:32:21 +02:00
|
|
|
HOSTNAME="${OS_DISTRO}-${INSTANCE_ID}"
|
2023-11-14 21:52:09 +02:00
|
|
|
|
|
|
|
cat meta-data | ruby replace.rb "##INSTANCE_ID##" "${INSTANCE_ID}" | ruby replace.rb "##HOSTNAME##" "${HOSTNAME}" > meta-data.in && \
|
2023-11-14 22:32:21 +02:00
|
|
|
cp -vf meta-data.in meta-data
|