Schedule Guiderails

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

tonysamson

Regular Contributor
Background:

I'm using Guiderails for my kids' devices and I find it really amazing. My only problem is that it is kinda very restrictive in a sense that it doesn't give them free time on a certain time of the day or during the weekends.

Issue:

To address my issue, I'm thinking of setting a cron job to turn on and off the "Enable DNS-based Filtering" at a certain time.

Question:

What SSH command should I use to turn on or off the "Enable DNS-based Filtering"?
 

Zastoff

Very Senior Member
Background:

I'm using Guiderails for my kids' devices and I find it really amazing. My only problem is that it is kinda very restrictive in a sense that it doesn't give them free time on a certain time of the day or during the weekends.

Issue:

To address my issue, I'm thinking of setting a cron job to turn on and off the "Enable DNS-based Filtering" at a certain time.

Question:

What SSH command should I use to turn on or off the "Enable DNS-based Filtering"?
Think this enable/disable dns-filter and for it to take effect.
Code:
nvram set dnsfilter_enable_x=0 or 1
nvram commit
service restart_firewall;restart_dnsmasq
 

tonysamson

Regular Contributor
Think this enable/disable dns-filter and for it to take effect.
Code:
nvram set dnsfilter_enable_x=0 or 1
nvram commit
service restart_firewall;restart_dnsmasq
Thank you so much. Based on your advise, I did the following:

1. Created a file named "services-start" in /jffs/scripts/

Code:
nano /jffs/scripts/services-start

2. In /jffs/scripts/services-start, I wrote this:

Bash:
#!/bin/sh
# This script gets called after all other system services
# have been started at boot on router
# ---------------------------------------------------------
cru a OnDNSFilter "0 18 * * 7 /jffs/scripts/On_DNS_Filter.sh"
cru a OffDNSFilter "0 15 * * 5 /jffs/scripts/Off_DNS_Filter.sh"

3. The Cron Job above will turn on DNS Filter at 6pm every Sunday and turn it off at 3pm every Friday.

5. Then I made "services-start" executable thru this command:

Code:
chmod a+rx /jffs/scripts/services-start

6. Created a script to turn On the DNS Filter:

Code:
nano /jffs/scripts/On_DNS_Filter.sh

7. In the On_DNS_Filter.sh file, I wrote the following:

Bash:
#!/bin/sh
# Purpose: Turn On DNS Filter. Block kids internet access
# Author: Tony Samson
# -------------------------------------------------------------
nvram set dnsfilter_enable_x=1
nvram commit
service restart_firewall
service restart_dnsmasq

8. Exited. Ctrl-X. Then saved the file. Then I made "On_DNS_Filter.sh" executable thru this command:
Code:
chmod a+rx /jffs/scripts/On_DNS_Filter.sh

9. Created a script to turn Off the DNS Filter:
Code:
nano /jffs/scripts/Off_DNS_Filter.sh

10. In the Off_DNS_Filter.sh file, I wrote the following:

Bash:
#!/bin/sh
# Purpose: Turn off DNS Filter. Allow kids internet access
# Author: Tony Samson
# -------------------------------------------------------------
nvram set dnsfilter_enable_x=0
nvram commit
service restart_firewall
service restart_dnsmasq

11. Exited. Ctrl-X. Then saved the file. Then I made "Off_DNS_Filter.sh" executable thru this command:

Code:
chmod a+rx /jffs/scripts/Off_DNS_Filter.sh

I'm sure other people will have a better way to do this. I just wanna write it down so others, not as technically proficient can also do it. Thank you so much for this very helpful community.

Btw, please let me know if I did something wrong. I won't really know if I did it right until my kids will complain about it. LOL.
 
Last edited:

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top