Skip to content

Instantly share code, notes, and snippets.

@thomasv314
Created July 20, 2017 20:45
Show Gist options
  • Save thomasv314/96e4a8b2706a8758c2ef064f3f6278cf to your computer and use it in GitHub Desktop.
Save thomasv314/96e4a8b2706a8758c2ef064f3f6278cf to your computer and use it in GitHub Desktop.
#!/bin/bash
instance_id=$(curl http://169.254.169.254/latest/meta-data/instance-id)
echo "$instance_id-server" > /etc/hostname
hostname -F /etc/hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment