that's my code, hacked together for the same purpose. although the above works I think the best way would be to grab the new list, compare it to what's in the database, and add/remove as needed. above would fail badly if firebog.net is not available for any reason.
p.s. the first 'sudo' on the second line isn't needed.
DELETE FROM adlist will remove all entries.
the insert command may or may not work (I didn't test it), however you'll end up with only the entries from the firebog list.
If you want to keep existing entries, and add possible new entries form the firebog list:
don't execute the delete command
change the INSERT command into INSERT OR IGNORE, this will prevent errors, when trying to add lists that are already in the database.
Again, I've never tested this command, it may or may not work
The example uses the ticked firebog list, I've been using the nocross firebog list. That's a choice you need to make, read here.
I have been using this script successfully. Don't forget to make the required changes (ticked or nocross). Of course, you'll need to run pihole -g after running the script.
Thanks for all the ideas/input. I've settled on the @jpgpi250 script since I prefer bash. Seems to work great, I only changed the paths for "sed" (not sure if you intended /tmp to be there) and added 'pihole -g' at the end as recommended.
a better solution than my ham-fisted attempt, but your script is lacking in that it won't pull out any lists that drop out of the firebog repo (your script only adds, never removes).