![]() sudo nano /etc/systemd/system/internet-access-schedule-off.timerĪnd in this file I write the following. Now I need to make the timer to go with the service. ĮxecStart=sqlite3 /etc/pihole/gravity.db "Update domainlist SET enabled = 0 WHERE type IN (3) and id in (61, 62) " I do the same thing in creating the rvice with the only difference being that I set enabled as 0 and change the description. You can find the id by simply hovering your mouse over the regex entry.Īfterwards, the service instructs Pi-hole to restart the dns and reload the lists. This is the id number to our domains we want to enable. I’m changing the enable field to 1 in type 3, this points to Pi-hole’s regex blacklist, and id 61 and 62. In this service, an entry in the Pi-hole gravity database found at /etc/pihole/gravity.db, namely, the domainlist database will be changed. ĮxecStart=sqlite3 /etc/pihole/gravity.db "Update domainlist SET enabled = 1 WHERE type IN (3) and id in (61, 62) " In this file, we add the following lines. Now that we have the filter and group created, it’s time to turn our attention to the Systemd timer. Then I add the internet-access-scheduler group to the domain filter. This filter, however, will be ALL domains. For my use, this will include my kids’ school and personal laptops and computers, phones, tablets, and TVs. First, I create a group called internet-access-scheduler, and then add all of the devices on my LAN that I want included in this group. With Pi-hole you can set groups of clients to only be affected by certain domain filters, and so, we’re going to use this feature. This wasn’t too difficult to do using Systemd timers and a little sqlite3 magic. ![]() Pi-hole is a great ad blocking dns filter, but I wanted to take it one step further and use it to completely block internet access to certain devices during a set period of time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |