# Scripting Adlist Management in v5

**URL:** https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962
**Category:** Customizing Pi-hole
**Tags:** v5-0
**Created:** [May 11, 2020, 1:23pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962 "2020-05-11T13:23:34Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![papasan](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@papasan](https://discourse.pi-hole.net/u/papasan)
#### Post date: [May 11, 2020, 1:23pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/1 "2020-05-11T13:23:34Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![e-renner](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/e/ea666f/32.png) [@e-renner](https://discourse.pi-hole.net/u/e-renner)
#### Post date: [May 11, 2020, 4:52pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/2 "2020-05-11T16:52:38Z")

</div>

Hi @ papasan,

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

---

<div class="post-metadata">

### Author: ![papasan](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@papasan](https://discourse.pi-hole.net/u/papasan)
#### Post date: [May 11, 2020, 5:14pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/3 "2020-05-11T17:14:54Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

### Author: ![fleegle61](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/f/ebca7d/32.png) [@fleegle61](https://discourse.pi-hole.net/u/fleegle61)
#### Post date: [May 12, 2020, 5:18pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/4 "2020-05-12T17:18:02Z")

</div>

> [@papasan](#):
>
> ```auto
> pihole -g
> 
> ```

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

---

<div class="post-metadata">

### Author: ![papasan](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/ee7513/32.png) [@papasan](https://discourse.pi-hole.net/u/papasan)
#### Post date: [May 27, 2020, 9:00pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/5 "2020-05-27T21:00:00Z")

</div>

there's more discussion [here](https://discourse.pi-hole.net/t/blocklist-management-in-pihole-v5/31971) with a better/updated script.

---

<div class="post-metadata">

### Author: ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)
#### Post date: [June 17, 2020, 9:06pm UTC](https://discourse.pi-hole.net/t/scripting-adlist-management-in-v5/31962/6 "2020-06-17T21:06:19Z")

</div>

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