Last active
January 21, 2016 12:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEFAULT_IP=127.0.0.1 | |
IP=${2:-$DEFAULT_IP} | |
sed -ie "\| $1\$|d" /etc/hosts | |
echo "$IP $1" >> /etc/hosts | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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