Although @smw 's answer looks like it might be your solution, there's nothing quite like "rolling your own" - if only for the satisfaction.
Building on my comment above, I am assuming that you can create a /etc/hosts file that gives you the permissions that you want. I am going to call them, as above, worktimeHosts
and playtimeHosts
. Now you need a script to set one or the other as the active file. This assumes that you have moved your /etc/hosts out of the way...
Create one script:
#!/bin/bash
rm /etc/hosts
ln -s /etc/worktimeHosts /etc/hosts
save it as /usr/bin/getWorking
, set permissions to execute chmod 755 /usr/bin/getWorking
Now create a second script:
#!/bin/bash
rm /etc/hosts
ln -s /etc/playtimeHosts /etc/hosts
save it as /usr/bin/getPlaying
, set permissions as before
You have to make sure you have permission to do these things to files in /etc...
Now edit the cron
table (see for example here)
`crontab -e`
Add a line like this:
00 00 08 * * /usr/bin/getWorking
And another line like this:
00 00 17 * * /usr/bin/getPlaying
I think that will be close to a solution - but I haven't tested this, so play with it and find my errors...
1You would have two files with configurations "for that time of day", and create a symbolic link from /etc/hosts to one or the other, depending on the time of day, using
cron
(or Automator on the Mac).worktimeHosts
andfreetimeHosts
... – None – 2013-02-07T19:05:38.887