What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Automatic a couple of tasks

MobTec

New Around Here
I've an ASUS RT N66U running ASUSWRT-Merlin and I'd like to automate two tasks:

1. Turning parental controls on/off
2. Turning the OpenVPN client on/off

I've been poking about with SSH and was wondering if this is the way to do this? And if so which commands should I be looking at? Is it pc and pc_block? Are there any guides as to how to do this sort of thing?

Thanks
 
The way I would do it:
- set all the settings for one task to work and set it to on in WebUI
- save Nvram with
nvram show | sort > /tmp/mnt/<your device>/nvram-on.txt
- turn task off, save nvram again:
nvram show | sort > /tmp/mnt/<your device>/nvram-off.txt
- look at the syslog and note down which service was restarted after the save in WebUI
- compare the two files and make a good guess what relevant setting changed for the on/off setting of task, Notepad++ has a compare function built in.
- write down the nvram setting change
- repeat for other task

Then write scripts to change the nvram settings, one for off, one for on, including the restart of the service.
- test it, if it works, add a cron job for the time you want it on and off
- lean back and enjoy the handy work.

Obviously the most satisfaction comes from doing it all yourself, so good luck, you'll have learned a lot and be proud of what you achieved.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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