Community discussions

 
makstex
newbie
Topic Author
Posts: 46
Joined: Fri Mar 27, 2009 6:31 am

Howto kill running ppp script?

Mon Apr 15, 2019 4:29 pm

I use the following script to control PPP connections (on-up in ppp profile ):
ping interface=[ / interface get $interface name ] address=($"remote-address") interval=00:00:05
After a PPP interface break, it remains running. Can you please tell me how to kill him?
 
User avatar
eworm
Member
Member
Posts: 332
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Howto kill running ppp script?

Tue Apr 16, 2019 12:37 pm

I use the following script to control PPP connections (on-up in ppp profile ):
ping interface=[ / interface get $interface name ] address=($"remote-address") interval=00:00:05
After a PPP interface break, it remains running. Can you please tell me how to kill him?
Try this, replace "ppp-script" with your script name:
/ system script job remove [ find where script="ppp-script" ];
You should consider changing your script...
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
makstex
newbie
Topic Author
Posts: 46
Joined: Fri Mar 27, 2009 6:31 am

Re: Howto kill running ppp script?

Thu Apr 18, 2019 7:49 am

This script has no name, it is launched via the ppp profile and they are launched for each PPP connection.
 
User avatar
eworm
Member
Member
Posts: 332
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Howto kill running ppp script?

Thu Apr 18, 2019 8:28 am

Are there any other unique criteria to find your nameless script? If there are non you shout consider putting it into "/ system script".
After all... what's the purpose of this ping?

BTW, ping knows an option "count=" to limit its runtime.

Or you do it in a loop:
:while ([ / interface get $interface running ] = true) do={ :delay 5s; / ping interface=[ / interface get $interface name ] address=($"remote-address") count=1; }
(Edit: fixed typo in script)
Last edited by eworm on Thu Apr 18, 2019 10:32 am, edited 1 time in total.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
makstex
newbie
Topic Author
Posts: 46
Joined: Fri Mar 27, 2009 6:31 am

Re: Howto kill running ppp script?

Thu Apr 18, 2019 9:29 am

Purpose: to check the life of the connection and to avoid the forced termination due to idle timeout.
Here is the profile:
/ppp profile add idle-timeout=1m local-address=10.0.0.1 name=ppp-in on-up="ping interface=[ / interface get \$interface name ] address=(\$\"remote-address\") interval=00:00:01" only-one=yes
Great idea with a while loop, thanks, now I'll try.
 
makstex
newbie
Topic Author
Posts: 46
Joined: Fri Mar 27, 2009 6:31 am

Re: Howto kill running ppp script?

Thu Apr 18, 2019 10:29 am

Its worked!
Thank you very much!
Last edited by makstex on Thu Apr 18, 2019 11:19 am, edited 1 time in total.
 
User avatar
eworm
Member
Member
Posts: 332
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: Howto kill running ppp script?

Thu Apr 18, 2019 10:33 am

Fixed the typo in original post. Thanks!
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts

Who is online

Users browsing this forum: No registered users and 4 guests