That’s a great idea. It works great but need to remove the -it flag.
To summarize:
- crontab -e in the host machine instead of the container
- add the lines below to the crontab, where ”pihole6" is the name of my pihole container.
0 15 * * * docker exec pihole6 pihole-FTL sqlite3 /etc/pihole/gravity.db "update 'group' set enabled = 0 where name = 'Kids-R'" && docker exec pihole6 pkill -SIGRTMIN+0 pihole-FTL
0 17 * * * docker exec pihole6 pihole-FTL sqlite3 /etc/pihole/gravity.db "update 'group' set enabled = 1 where name = 'Kids-R'" && docker exec pihole6 pkill -SIGRTMIN+0 pihole-FTL
- save and exit