Add all whitelist items to all groups

Please follow the below template, it will help us to help you!

I have 250+ whitelisted items but with the move from v4 > v5 they were all assigned to other, from what i see i need to go through each one and assign each one to all groups

Expected Behaviour:

Bulk assign whitelisted domains to all groups

Actual Behaviour:

I need to one by one go through 250+ items and press 'all' for each one, is there a script i can use to do this?

Debug Token:

# Adds all whitelist exact to all groups

# define path to pihole's databases and temporary database

#define and initialize variables
declare -a domain_ids
declare -a group_ids

group_ids=(`sqlite3 $GRAVITY "select id from 'group'"`)
domain_ids=(`sqlite3 $GRAVITY "select id from domainlist where type=0"`)

for domain in "${domain_ids[@]}"; do
    for group in "${group_ids[@]}"; do
        sqlite3 $GRAVITY "insert or replace into domainlist_by_group(domainlist_id, group_id) values ($domain, $group);"

No, they are all added to the "Default" group. Just leave this group attached to all clients and they will all see the whitelisted domains.

This would work for some, but i have seperated my clients into groups like smart home devices etc,

what do i change for this?

Ah sorry...


thank you, its working fine

btw i had to copy the gravity.db to a different folder then move it back again as i was geting a database locked error but it worked great!

This might be due to simultaneous access by FTL

Next time perform

sudo service pihole-FTL stop

DATABASE manipulation

sudo service pihole-FTL start