disable/enable pptp interface script needed

Hello
i need script to disable and enable pptp interface (pptp-client-out) in 1 min and repeating it.
thanks

please script on plaintext exactly what do you want the script do…

i want pptp-out1 work for 1 min, and afther 60s disable and enable again.it should stop every 1min and start again.(auto restart in custom time)

can anyone help me?

Hi, schedule this each two minutes:
/interface pptp-client disable pptp-out1;
:delay 60s;
/interface pptp-client enable pptp-out1;(assuming it is client side - otherwise use “server” instead “client” in both lines). It will be 1 minute on, and 1 minute off.

Or you want to shut it down each minute and up immediatelly afterwards? Then schedule this each minute:
/interface pptp-client disable pptp-out1;
/interface pptp-client enable pptp-out1;Have you read the documentation (http://wiki.mikrotik.com/wiki/Manual:Interface/PPTP)?

What is the reason for such activity? It will break your connections…

i want turn of it for 4 sec and run again.
many thanks

Ok. Glad I helped you. But what is the reason for this?

it is for some testing(speed) ,also i wanted disable it in custom time (not realy 1 min).
your script work (2rd) but it is possible to stop 4s and start again? not immediatelly .
thank you so much.

Of course. Just put delay line between with as much seconds as you need.

yes it works fine :slight_smile: , and final question,i can run it on routeros 5.x and olders?

Yes, are the same instructions.

It work on 5.x and 6.x but I’m not sure for 4.x and previous.

Use full syntax for compatibility:

/interface pptp-client disable > [find where name="> pptp-client-out> “]> ;
:delay > delay-time=> 60;
/interface pptp-client enable > [find where name=”> pptp-client-out> "]> ;

the “s” for seconds can be used, but is better to not be specified.

/interface pptp-client disable > [find where name="> pptp-client-out> “]> ;
/interface pptp-client enable > [find where name=”> pptp-client-out> "]> ;


I’m writing in this moment one script for you, if you wait one or two minutes, I post the script here.

Schedule this at Routerboard boot:

(i assume the interface is named pptp-out1)

:delay delay-time=60;
:while (1<>2) do={
 /interface pptp-client disable [find where name="pptp-out1"];
 :delay delay-time=4;
 /interface pptp-client enable [find where name="pptp-out1"];
 :delay delay-time=60;
};

EDIT: Removed comments for 5.x compatibility.

Check the interface name on the script!!!

i assume the interface is named pptp-out1

and check again the script, please fix here my comment, my english is not well…

seem script not work, or maybe i am worng. scrip runing but cannot enable,disbale interface.
666.JPG

I usually paste the script directly on “on event” windows without creating one separate script.

Set interval to 00:00:00

I find the problem, remove all the # comment inside the scritpt… on 5.x the # comment inside do={ } cause compiler errors…