Skip to content

Instantly share code, notes, and snippets.

@mpneuried
Last active January 21, 2016 12:29
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 mpneuried/1767c74aac0722dfead0 to your computer and use it in GitHub Desktop.
Save mpneuried/1767c74aac0722dfead0 to your computer and use it in GitHub Desktop.
Scritp's to change /etc/hosts. Tahnks to Claus Witt, http://clauswitt.com/319.html.
DEFAULT_IP=127.0.0.1
IP=${2:-$DEFAULT_IP}
sed -ie "\| $1\$|d" /etc/hosts
echo "$IP $1" >> /etc/hosts
exit 0
sed -ie "\| $1\$|d" /etc/hosts
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment