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

Script doesnt respect if entry is already present #145

Open
RichardBeisser opened this issue Dec 16, 2023 · 5 comments
Open

Script doesnt respect if entry is already present #145

RichardBeisser opened this issue Dec 16, 2023 · 5 comments

Comments

@RichardBeisser
Copy link

Hello,

it seems that the script doesnt check if an entry for a certain domain is already defined.
How can I enable this behaviour?

There should be a running mode which
a) only add entries when no entry for a domain ist set manually
b) modify and delete only entries which were created by the script.

I think the only way to mark an entry as managed by your script is to use the comment

Thanks

@RichardBeisser
Copy link
Author

RichardBeisser commented Dec 16, 2023

https://github.com/jacklul/pihole-updatelists?tab=readme-ov-file#migrating-lists-and-domains

I read this. This refer only that your script will not overwrite comment-field if entry is already exists.
But it seems that the script is overwriting existing group-assigments

Example: see attached config-file + youtube.com
pihole-updatelists.conf.txt
youtube.com is whitelisted for group-id 3 only. comment for youtube.com = "my comment"
After running the script, youtube.com has still the comment "my comment" (that is very good!), but groups has been changed from 3 to 0+1, according the config-file.
There should be an option saying the script that it shall change nothing if entry already exists and is not set by the script.

another point, a feature request:
there should be a ignore-option for whitelisting for certain domains
a blacklisted entry can be "overwritten" by setting a whitelist-entry, because wl has a higher priority. It would be great if you can exclude certain domains / regex from whitelisting.

In words of your options:
WHITELIST_IGNORE " "
REGEX_WHITELIST_IGNORE " "

Thanks a lot.

@jacklul
Copy link
Owner

jacklul commented Dec 17, 2023

Example: see attached config-file + youtube.com
pihole-updatelists.conf.txt
youtube.com is whitelisted for group-id 3 only. comment for youtube.com = "my comment"
After running the script, youtube.com has still the comment "my comment" (that is very good!), but groups has been changed from 3 to 0+1, according the config-file.

I will look into this when I can

another point, a feature request: there should be a ignore-option for whitelisting for certain domains a blacklisted entry can be "overwritten" by setting a whitelist-entry, because wl has a higher priority. It would be great if you can exclude certain domains / regex from whitelisting.

In words of your options: WHITELIST_IGNORE " " REGEX_WHITELIST_IGNORE " "

I rather not add a functionality like this - you could wget the list and filter it with sed then provide local path in the config file instead.

@jacklul
Copy link
Owner

jacklul commented Dec 17, 2023

Check if the newest develop version fixes mentioned issue.

@RichardBeisser
Copy link
Author

RichardBeisser commented Dec 17, 2023

Check if the newest develop version fixes mentioned issue.

just tested your new script.
Great Job, it now ignores an entry completely when it exists

I rather not add a functionality like this - you could wget the list and filter it with sed then provide local path in the config file instead.

the advantage if the script would do that is that you can apply it on all lists at the same time

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

No branches or pull requests

2 participants