1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Schedule to enable/disable AiProtection

Discussion in 'Asuswrt-Merlin' started by Robin, Jun 14, 2018.

  1. Robin

    Robin New Around Here

    Joined:
    Dec 27, 2017
    Messages:
    5
    Hi folks!

    I'm trying to figure out how to control (simply to enable and disable) AiProtection from the command line. What I would like to do is, set up a cron-based schedule to enable and disable AiProtection Parental Controls (or a client entry within it - I don't mind which).

    The problem is, AiProtection offers Web & Apps Filters, and Time Scheduling, but not the intersection of the two: I would like to permit all access to a device normally, but filter out certain apps/websites during set times of particular days (6am-6pm M-F only). The result would be: other (not listed) client devices have unrestricted access at all times. Listed device(s) have unrestricted access outside the scheduled times, restricted access (but still have internet access) within those times.

    I think the following are the cru commands to create the schedule, and I understand I'd need to set up a jffs script those commands to make them survive router reboots... I just need the missing command.

    cru a filtering-on "0 6 MON-FRI * * [turn AiProtection Parental Controls on]"
    cru a filtering-off "0 18 MON-FRI * * [turn AiProtection Parental Controls off]"

    Any ideas?
     
    Last edited: Jun 14, 2018
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. FreshJR

    FreshJR Very Senior Member

    Joined:
    Oct 8, 2016
    Messages:
    799
    Disable

    Code:
    nvram set wrs_app_enabled=0
    nvram set wrs_enable=0
    service "restart_wrs;restart_firewall"
    
    Enable


    Code:
    nvram set wrs_app_enabled=1
    nvram set wrs_enable=1
    service "restart_wrs;restart_firewall"
    
     
    Robin likes this.
  4. Robin

    Robin New Around Here

    Joined:
    Dec 27, 2017
    Messages:
    5
    Awesome - thank you so much!
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!