Script for checking the running flag of a vpn tunnel

Hello all,

maybe this is a trivial question, but this forum doesnt allow to search for the keyword “running”.

I want to do something like the following:

:if ([/interface l2tp-client get vpn running]) do={

}

But this isnt working, i dont know why.

:put [/interface l2tp-client get vpn running]

results in

true

and

:put ([/interface l2tp-client get vpn running] = true)

results in

false


What am i doing wrong?



Thanks.

Juergen

you must convert to bool

:if ( [:tobool [/interface pptp-client get pptp-out1 running ]] 
= true ) do={ :put "yeee" } else={ :put "grrrr" }

This isn’t working as well.

:put ([:tobool [/interface l2tp-client get l2tp-server running]] = true)

still yields false.

This seems to be a bug in version 3.0 as on my 2.9 live routers, this condition is working.
Thank you.


Juergen

Ah yes if you are using v3.0beta9 then it won’t work. On beta9 new variable system was introduced, because of that there are many bugs.

you can read more in this thread:
http://forum.mikrotik.com/t/things-broken-in-beta9/13797/1

yes, scripting and vars in beta9 are very buggy. Expecting b10 soon I hope.