Skip to content

Instantly share code, notes, and snippets.

@chris-roerig
Last active August 29, 2015 14:10
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 chris-roerig/bb7077e2e3ff742e5cdb to your computer and use it in GitHub Desktop.
Save chris-roerig/bb7077e2e3ff742e5cdb to your computer and use it in GitHub Desktop.
A simple script to swap the hosts file
#!/bin/bash
case "$1" in
live)
cp /etc/hosts.live /etc/hosts
echo "Now using the live hosts file"
exit
;;
stage)
cp /etc/hosts.stage /etc/hosts
echo "Now using the stage hosts file"
exit
;;
*)
cp /etc/hosts.local /etc/hosts
echo "Now using the local hosts file"
exit
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment