Skip to content

Instantly share code, notes, and snippets.

@djdevin
djdevin / manage-etc-hosts.sh
Created February 21, 2019 15:49 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1