Skip to content

Instantly share code, notes, and snippets.

@nobleach
Created June 3, 2014 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nobleach/d196eabe801ad2789fb6 to your computer and use it in GitHub Desktop.
Save nobleach/d196eabe801ad2789fb6 to your computer and use it in GitHub Desktop.
Quick nasty hosts file swiitch
HOSTS_FILE="/etc/hosts"
PRISTENE_HOSTS="$HOME/hosts-clean"
TEST_ENV_HOSTS="$HOME/hosts-test"
function switchhosts {
if [ $1 = "prod" ]
then
sudo cp "$PRISTENE_HOSTS" "$HOSTS_FILE"
fi
if [ $1 = "test" ]; then
sudo cp "$TEST_ENV_HOSTS" "$HOSTS_FILE"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment