jacklul / pihole-updatelists

Update Pi-hole's lists from remote sources easily
MIT License
1.42k stars 82 forks source link

Do I need to uncomment the [Timer] section? #151

Closed Gil80 closed 8 months ago

Gil80 commented 8 months ago

Reading about sudo systemctl edit pihole-updatelists.timer I expected these lines to be uncommented - so now I'm not sure if the update script will run.

image

That's my current pihole-updatelist.conf file looks like:


; Remote list URL containing list of adlists to import
; URLs to single adlists are not supported here!
ADLISTS_URL="https://v.firebog.net/hosts/lists.php?type=tick"

; Remote list URL containing exact domains to whitelist
WHITELIST_URL="https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt"

; Remote list URL containing regex rules for whitelisting
REGEX_WHITELIST_URL=""

; Remote list URL containing exact domains to blacklist
; This is specifically for handcrafted lists only, do not use regular blocklists here!
BLACKLIST_URL=""

; Remote list URL containing regex rules for blacklisting
REGEX_BLACKLIST_URL="https://raw.githubusercontent.com/mmotti/pihole-regex/master/regex.list"

UPDATE_GRAVITY=true
REQUIRE_COMMENT=true
COMMENT="Managed by pihole-updatelists"

p.s. - running pihole-updatelists -v says it needs root privileges. Is that OK? or do I need to configure somewhere for it to run with sudo?

jacklul commented 8 months ago

I expected these lines to be uncommented - so now I'm not sure if the update script will run.

Read carefully what the lines starting with ### say - you need to add your modification between them. The lines at the bottom show the original file for reference only.

p.s. - running pihole-updatelists -v says it needs root privileges. Is that OK? or do I need to configure somewhere for it to run with sudo?

Running with sudo equals running as root.

Gil80 commented 8 months ago

Read carefully what the lines starting with ### say - you need to add your modification between them. The lines at the bottom show the original file for reference only.

So just to be clear that I understand - if I don't want to modify the schedule, I should leave it as it is with the # (comment)?

Running with sudo equals running as root.

I know, I'm trying to understand if the script will run automatically without issues, because if I need to provide root privileges when running manually, I expect the script to fail when it run automatically, isn't it?

jacklul commented 8 months ago

So just to be clear that I understand - if I don't want to modify the schedule, I should leave it as it is with the # (comment)?

In this case you want to leave everything as it is - you shouldn't be even executing sudo systemctl edit pihole-updatelists.timer in the first place.

I know, I'm trying to understand if the script will run automatically without issues, because if I need to provide root privileges when running manually, I expect the script to fail when it run automatically, isn't it?

No, scheduled run already runs as root.

Gil80 commented 8 months ago

Thank you. Is there a log I can monitor to verify it actually ran automatically?

jacklul commented 8 months ago

These should work: systemctl status pihole-updatelists.timer systemctl status pihole-updatelists.service

Gil80 commented 8 months ago

Looks ok - isn't it? Thanks for the help image

jacklul commented 8 months ago

Yes, the timer is waiting to be executed