Skip to content

Comments

Add a config file support#1

Open
badcrc wants to merge 1 commit intotinuzz:masterfrom
badcrc:master
Open

Add a config file support#1
badcrc wants to merge 1 commit intotinuzz:masterfrom
badcrc:master

Conversation

@badcrc
Copy link

@badcrc badcrc commented Oct 11, 2019

For adding hosts without restarting the script.

It reads a list of hosts from a file in every execution so you can have the daemon running all the time and just add or remove new hosts.

@tinuzz
Copy link
Owner

tinuzz commented Oct 11, 2019

Hi,

Can you make it so that the config file can be specified on the command line, and one doesn't have to change the script to use (or not use) a config file?

The easiest solution (albeit a bit ugly) would probably be to check the first character of the first argument, and if it's a '/', treat it as a file. Or do it like cURL, and treat names that start with a character like '@' as a file (stripping the @, of course). Both solutions would be acceptable to me.

Thanks for contributing, I appreciate it!

Best regards,
Martijn.

@tinuzz
Copy link
Owner

tinuzz commented Oct 11, 2019

Or....

Add a note about the config file in the 'Configuration' section of the README.

But as it currently is, it uses a config file by default, and throws an exception if the file doesn't exist. Maybe change the default to None?

Best regards,
Martijn.

@badcrc
Copy link
Author

badcrc commented Oct 12, 2019

Hmm I can check if the argument is a file/path or a host/hosts list.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants