Skip to content

Instantly share code, notes, and snippets.

@joeyblake
Created February 27, 2012 16:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joeyblake/1925033 to your computer and use it in GitHub Desktop.
Save joeyblake/1925033 to your computer and use it in GitHub Desktop.
Shell script for cleaning/resetting /etc/hosts files messed up by MAMP Pro
#!/bin/bash
# copy this file to /usr/sbin
# if you have other hosts entries that you would not like to lose, make sure they get added to the hosts.mamp.bak file
cat /etc/hosts.mamp.bak > /etc/hosts
echo 'clean!'
@joeyblake
Copy link
Author

One line install

Open up your terminal and run this command
curl https://raw.github.com/gist/1925033/88a479a363b211253d0444fe7d4e2cf5afcc6f75/hostfix > /usr/sbin/hostfix && chmod a+x /usr/sbin/hostfix

Usage

This will need to be run as sudo
sudo hostfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment