4 ms·
If I understood correctly it should be as simple as having an extra file setup to replace your hosts file say /etc/hosts.override and put all your blocked hosts
by wwortiz 16y ago
If I understood correctly it should be as simple as having an extra file setup to replace your hosts file say /etc/hosts.override and put all your blocked hosts there along with your regular hosts file.
Then you just add a 30 minute cron job to do
cp /etc/hosts.override /etc/hosts
- bluishgreen 16y agoThis is exactly how you do it. Setting up a cron job to run every 30 minutes can be done like this: crontab -e and put this line in there 0,30 * * * * your_command or like 0/30 * * * * your_command. The second one works for me, I am on a mac. Make sure the user who runs the job has permission to overwrite the file.
- ekanes 16y agoFantastic thanks. Running with that and extending it a bit.. I want it to turn distractions off between 8am to 11am, I'm doing it with hosts.on and hosts.off, so I can have it all come back online again at 11am. Cheers!