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?
#!/bin/bash
# Adds all whitelist exact to all groups
# define path to pihole's databases and temporary database
GRAVITY="/home/chrko/sonstiges/Netzwerk/Pi-Hole/pihole_all_groups/gravity.db"
#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);"
done
done