Hi all.
We use this script to connect remote offices to main office even if main link in main office down.
This script working fine on 3.30 but on 4.17 it fails and highlighting equals sign in red.
I can’t find what wrong.
Can somebodey help me with this?
:if ([/ping [/interface l2tp-client get office_main connect-to] count=10]<3) do={:global s1 “na”; interface
l2tp-client monitor [find name=“office_backup”] once do={:set s1 $status}; :if ($s1=“disabled”) do={:log info “Main
vpn link down, will try to switch to backup one.”; :if ([/ping [/interface l2tp-client get office_backup connect-to]
count=10]>5) do={:log info “We can ping backup interface, going to use it”; /interface l2tp-client disable [find
name=office_main]; interface l2tp-client enable [find name=office_backup]} else={:log info “We can’t ping backup
interface, just waiting”}}} else={:global s “na”; interface l2tp-client monitor [find name=“office_backup”] once
do={:set s $status}; :if ($s!=“disabled”) do={:log info “Main link up, going to connect vpn”; /interface l2tp-client
disable [find name=office_backup]; interface l2tp-client enable [find name=office_main]}}
open in winbox new terminal, or simple login through ssh or telnet, open your script in there, like, /system script edit myscript source and using F5 key refresh the highlighting. Where highlighting stops most probably you have an error, since scripting was updated from 3.x to 4.x
Thank you but this doesn’t help. When in edit mode it highglight equals sign in red also. If I delete equals sign and type it again, no red highghlight in edit mode but after save doing scripts print shows this equals sign in red again. I can’t understand what the problem with it.
you can look here:
http://wiki.mikrotik.com/wiki/Scripting
and look some scripting examples on the wiki or forums for RouterOS 4.x
That red means syntax error, some extra space or something.
Thank you.
But where can I find info about diffrences in script language between 3.30 and 4.17?