Skip to content

Instantly share code, notes, and snippets.

@olissongs
olissongs / manage-etc-hosts.sh
Last active December 16, 2016 15:09 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/bash
# copy from https://gist.github.com/irazasyed/a7b0a079e7727a4315b9
# modifyed for ubuntu 16.04
# commandline call: sudo ./manage-etc-hosts.sh addhost yourhost
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME