Skip to content

A simple program to generate hosts file from specified blocklist URLs.

License

Notifications You must be signed in to change notification settings

randalthor17/genhosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

genhosts

License C++

A simple program to generate hosts file from specified blocklist URLs.

Table of Contents

Features

  • Downloads specified blocklist URLs in /etc/genhosts/config.toml
  • Concatenates each one, ordered by priority
  • Removes duplicate entries
  • Hosts download directory, output location
  • Dumps default config to /etc/genhosts/config.toml if specified
  • Restores default /etc/hosts if specified
  • Loads config from a custom file if specified

Prerequisites

  • A C++ compiler with C++20 support
  • Meson build system
  • libcurl library

Installation

  1. Clone the repository:
git clone https://github.com/randalthor17/genhosts.git
  1. Navigate to the project directory:
cd genhosts
  1. Generate meson build directory:
meson setup -Dbuildtype=release -Db_strip=true --prefix=/usr build

Note: You can change the prefix to ~/.local to do a local installation.

  1. Build the project:
meson compile -C build
  1. Install the project:
meson install -C build

Usage

genhosts [OPTION...]

  -c, --config arg              Configuration file location (default: 
                                /etc/genhosts/config.toml)
      --hosts-save-dir arg      Hosts file download directory (default: 
                                /etc/hosts.d)
  -o, --output arg              Hosts output path (default: /etc/hosts)
  -s, --dump-config [=arg(=/etc/genhosts/config.toml)]
                                Dump config to a specific path
      --restore [=arg(=/etc/hosts)]
                                Restore hosts file
  -h, --help                    Print help

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple program to generate hosts file from specified blocklist URLs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published