Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for reading hosts/subnets from a file #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

urhot
Copy link

@urhot urhot commented Apr 20, 2023

This pull requests adds new argument to allow reading the hosts/subnets from a file.

This is sort of a duplicate of another pull request #42, but with a different approach. I leave it up to the author to decide if he wants to go forward with either of these.

Usage

New parameter: --routes-file <filename> or -f <filename>

For example:

vpn-slice --routes-file=/home/bob/.vpn-routes

The routes file should have one host per line, with optional comments:

# This is a comment
192.0.2.1
# Another comment
test1.example.com # one more comment
test2.example.com

To be considered

  • Are the argument names good? Is it acceptable to dedicate -f for this feature?

Differences to the implementation in #42

  • The provided file is not called a "config file", but just a list of hosts
  • Does not use fromfile_prefix_chars, but instead a simple custom parser that knows how to handle comments

New parameter: --routes-file <filename> or -f <filename>

Syntax is one host per line. Single-line or postfix comments are
handled and ignored.

For example:

1.2.3.4
host1.example.com # This is one more comment
host2.example.com
@nstp11
Copy link

nstp11 commented Aug 2, 2023

Hi all, is there any update on this case?
Will we add this enhancement?

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants