Skip to content

Latest commit

 

History

History
52 lines (43 loc) · 983 Bytes

README.md

File metadata and controls

52 lines (43 loc) · 983 Bytes

hostf

Sometimes you need to manage your hosts file /etc/hosts.
Some do it on a daily basis.

This Python script will do it for you faster than lightning ⚡ ✨

Installing

Clone and cd into dir.

$ git clone [email protected]:dunderrrrrr/hostf.git && cd hostf/

Add to ~/.bashrc.

alias hostf='sudo /usr/bin/python3 /home/user/path/hostf/hostf.py'

Reload shell or restart terminal.

$ source ~/.bashrc

Usage

Add / delete / show records

$ hostf -a 10.1.1.50 example.com
$ hostf -d 10.1.1.50
$ hostf
127.0.0.1   localhost
10.1.1.5    test-serv
10.10.1.7   example.com

Help

$ hostf -h
usage:
[ADD] hostf -a <ip> <hostname>
[DEL] hostf -d <ip>

hostf will manage /etc/hosts faster than lightning.

optional arguments:
  -h, --help            show this help message and exit
  -a 10.1.1.5 test.com  Add to hosts.
  -d 10.1.1.5           Delete from hosts.