3 ms·
Ask HN: looking for a linux script/app to block my Internet from 10pm-6am?
2 months ago I didn't have the internet for about a 6 month stretch. In terms of going to bed on time and being rested, no other time in my life compares.
I'm looking for something similar to http://macfreedom.com/ but for linux and instead of setting a 3 hour break, I would like it to start automatically at 10pm and stop automatically at 6am.
Any scripts/apps out there like this? Or any pointers on how to write one?
- csmeder 17y agonote: I didn't have TV and still don't (as it would foil this plan)...
- ecyrb 17y agoas su, add crontab entries to call ifup and ifdown: ("crontab -e" to edit crontab) * 22 * * * ifdown eth<X> * 6 * * * ifup eth<X> where <X> is your ethernet interface.
- ecyrb 17y agoJust putting it out there, and I'm not 100% sure, but I suspect that stackoverflow.com might have been a better venue for this sort of question.
- csmeder 17y agoso this should work? (I am using Lan so I'm guessing eth0) # m h dom mon dow command * 22 * * * ifdown eth0 * 6 * * * ifup eth0
- ecyrb 17y agoI would guess so. You can check your interfaces with the "ifconfig" command.
- pasbesoin 17y agoI seem to recall that some routers/hubs support schedules. In the personal equipment arena, maybe something that can be flashed with a version of WRT or with Tomato? E.g. (although it appears to be only controlling the wireless radio as opposed to overall connectivity): Precise Radio Scheduling with DD WRT http://markspizz.net/?p=389 http://markspizz.net/?p=389 Then again, if you have other data (entertainment, Netfix, etc) flowing through the same equipment, this approach may not suit or may need refinement.