yes I understand and it is important to specify it.
Thank you for this additional information.
In my case, my devices have several groups and I have a specific group for school hours. so in my case it is the group that I deactivate. what I did so far by hand, and thanks to you it will be automatic.
thank you again for your help and for the speed of your response.
This thread is awesome. Is there a way to do this with an adlist instead? By updating the adlist table? I've got an adlist that blocks youtube and such, and it's applied to a couple of clients. I can enable and disable the adlist from the GUI and it works flawlessly. When I update the adlist table and set enabled = 0, I can see the list disabled in the GUI, but the domains still work. I've tried pihole restartdns reload-lists, but no dice.
I'm missing something. What is it?
I had a similar problem where the cron job disabling my "Block" group wouldn't actually stop blocking clients, the GUI showed the change, but the behavior wouldn't change until I toggled the Enabled / Disabled button for my "Block" group in the GUI or restarted DNS, so I landed on this which is working for me:
0 23 * * 0-4 sqlite3 /etc/pihole/gravity.db "update 'group' set enabled = 1 where name = 'Block'" >> /tmp/pihole_group.log 2>&1
0 6 * * 1-5 sqlite3 /etc/pihole/gravity.db "update 'group' set enabled = 0 where name = 'Block'" >> /tmp/pihole_group.log 2>&1
1 6 * * 1-5 PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole restartdns >> /tmp/restartpihole.log 2>&1
Can we leverage client to group assignment mapping - to enable/disable applicable blocking lists? Pi-hole
Above methods are using enable/disable of lists themselves.
I would prefer to not change the status of lists or groups but rather remove or apply their assignment to specific clients to get the blocking results.