Hi all,
I've come up with a solution to my troubles of the parental controls feature not enforcing the disabling of devices on my ASUS router.
I got the idea from a few other scripts I have seen floating around, but i wanted more flexibility, as I change the time scheduling for my kids on weekends, school holidays or as reward/punishment for certain behaviours.
As such, I didn't want to create new cron jobs every time I made a change, so I decided to write a script that reads the settings in my parental controls, and drops/reinstates connections based on that - no matter how often I modify it.
The scripts are attached (rename them and remove the ".txt" extension) for you to use.
Additionally, you will need to setup a cron job to run the script every minute, by placing the following in /jffs/scripts/servies-start
The script is fully documented in the event you want to know how it works, and additionally, you can run it manually with the folowing parameters:
I hope others find it useful, and if you find any bugs, please post them here so myself and others can fix them.
I've come up with a solution to my troubles of the parental controls feature not enforcing the disabling of devices on my ASUS router.
I got the idea from a few other scripts I have seen floating around, but i wanted more flexibility, as I change the time scheduling for my kids on weekends, school holidays or as reward/punishment for certain behaviours.
As such, I didn't want to create new cron jobs every time I made a change, so I decided to write a script that reads the settings in my parental controls, and drops/reinstates connections based on that - no matter how often I modify it.
The scripts are attached (rename them and remove the ".txt" extension) for you to use.
Additionally, you will need to setup a cron job to run the script every minute, by placing the following in /jffs/scripts/servies-start
Bash:
# setup the cron job to enforce blocked devices
cron_exists=`cru l | grep enforceTimeScheduling | wc -c`
if [ $cron_exists -gt 0 ]; then
cru d enforceTimeScheduling
fi
# schedule the device blocking Script
cru a enforceTimeScheduling "*/1 * * * * /jffs/scripts/enforceTimeScheduling.sh"
The script is fully documented in the event you want to know how it works, and additionally, you can run it manually with the folowing parameters:
Code:
-v: Verbose - tells you everything it found and is doing
-t: Test mode - do not do anything, just print the commands to screen
I hope others find it useful, and if you find any bugs, please post them here so myself and others can fix them.