Page 1 of 1

shutting down interfaces at a specific time

Posted: Fri Sep 25, 2015 12:14 pm
by 1001001
Hello everybody,

would it be possible to write a script that shutsdown an interface, lets say between 2200h and 0600h everyday?
If yes does somebody out there have a code snippet i can use to get started?

Best regards

1001001

Re: shutting down interfaces at a specific time

Posted: Fri Sep 25, 2015 1:29 pm
by PaulsMT
If You want to run only one command on specific time, you don't need a script, you can just add scheduler:

to disable interface at 22:00
/system scheduler add start-time=22:00:00 on-event={:interface ethernet disable ether5}

second scheduler to enable interface at 6:00
/system scheduler add start-time=06:00:00 on-event={:interface ethernet enable ether5}

Re: shutting down interfaces at a specific time

Posted: Fri Sep 25, 2015 1:43 pm
by 1001001
Thanks for your answer.
What if we had to do this at different times on different days?

Best regards

1001001

Re: shutting down interfaces at a specific time

Posted: Sat Sep 26, 2015 12:58 pm
by freemannnn
you have to make schedules that start for example 26-09-2015 "saturday" and repeat "weekly" so it runs every week same day