Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
/ goodhosts-cli Public archive
forked from goodhosts/cli

Simple hosts file management in a Go cli [Archived]

License

Notifications You must be signed in to change notification settings

crc-org/goodhosts-cli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goodhosts cli, fork of Lex Toumbourou's project goodhosts

Simple hosts file (/etc/hosts) management in a Go cli. One simple interface for any OS or architecture, script and automate hosts file updates using one simple tool.

Features

  • List, add, remove and check hosts file entries from code or the command-line
    • Remove by IP, Host, or IP/Host
    • check returns proper exit codes for scripting e.g. goodhosts check 10.0.5.12 || echo "Missing hosts entry for 10.0.5.12"
  • linux/darwin/windows support
  • Custom hosts file support
  • Backup/Restore
  • Quick inline editor (vim/nano)

Installation

Visit the releases page and download the proper binary for your architecture. Unzip and run in place, put in your system path (linux: /usr/local/bin win: ~/bin) for easier access.

Usage

For full usage directions simply call goodhosts -h

$ ./goodhosts -h
   NAME:
      goodhosts - manage your hosts file goodly
   
   USAGE:
      goodhosts [global options] command [command options] [arguments...]
   
   COMMANDS:
      check, c       Check if ip or host exists
      list, ls       List all entries in the hostsfile
      add, a         Add an entry to the hostsfile
      remove, rm, r  Remove ip or host(s) if exists
      debug, d       Show debug table for hosts file
      backup         Backup hosts file
      restore        Restore hosts file from backup
      help, h        Shows a list of commands or help for one command
   
   GLOBAL OPTIONS:
      --custom value  override the default hosts file
      --debug, -d     Turn on verbose debug logging (default: false)
      --quiet, -q     Turn on off all logging (default: false)
      --help, -h      show help (default: false)

Each sub-command can be called with a -h option to see detailed help information.

 $ ./goodhosts list -h
 NAME:
    goodhosts list - List all entries in the hostsfile
 
 USAGE:
    goodhosts list [command options] [arguments...]
 
 OPTIONS:
    --all       Show all entries in the hosts file including commented lines. (default: false)
    --help, -h  show help (default: false)

License

MIT

About

Simple hosts file management in a Go cli [Archived]

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 89.0%
  • Makefile 11.0%