Skip to content

Instantly share code, notes, and snippets.

@teddevaal
Created January 20, 2015 15:17
Show Gist options
  • Save teddevaal/7a83799244ae500c0711 to your computer and use it in GitHub Desktop.
Save teddevaal/7a83799244ae500c0711 to your computer and use it in GitHub Desktop.
set_hostname on unix machine
#!/bin/bash
export PROJECT='PROJECTNAME'
export ENV='ENVIRONMENT'
export HOSTNAME="$PROJECT"-"$ENV"
rm -rf /etc/hostname
echo $HOSTNAME | sudo tee -a /etc/hostname
hostname $HOSTNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment