Scripting Adlist Management in v5

I use the Firebog repo to get a list of adlists that my local PiHole uses, this is applied with an upgrade script I use to keep everything fresh. the line is...

sudo wget -qO - https://v.firebog.net/hosts/lists.php?type=tick -O /etc/pihole/adlists.list

...now that everything is maintained in a database instead of a flat file, how can I dump the current db of block lists and create a new one from the Firebog list?

Hi @ papasan,

A similar question ist disscused at
https://discourse.pi-hole.net/t/blocklist-management-in-pihole-v5

so I poked around a bit and answered my own question...

sudo sqlite3 /etc/pihole/gravity.db "DELETE FROM adlist"
sudo wget -qO - https://v.firebog.net/hosts/lists.php?type=tick |xargs -I {} sudo sqlite3 /etc/pihole/gravity.db "INSERT INTO adlist (Address) VALUES ('{}');"
pihole -g
1 Like

Just tried it out, seems to work nicely. Just have to put it into a cron job and you have a daily process

there's more discussion here with a better/updated script.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.