I'm running RouterOS 6.31 and all scripts fails to access the variables defined as global if the script runs from the scheduler. But if I run any script from the the CLI everything works fine.
I was using the No-Ip script ( http://wiki.mikrotik.com/wiki/Dynamic_D ... _No-IP_DNS ) in RouterOS version 6.2x and never see a problem until last update. After seen that the problem was the global variable used in it I made a small script to test the behavior of the variables and can't find the problem.
The test script it's simple, a bunch of put and log to debug it and the attributes are read,write and test (in CLI and from Scheduler).
---------
:global str1
:local str2 "something"
:put "Test: $str1"
:log info "Test: $str1"
:if ( $str1 != $str2 ) do={
:put "Mismatch"
:log info "Mismatch - $str1 - $str2"
:set $str1 $str2
} else={
:put "Equal"
:log info "Equal"
}
---------
The first run from the CLI it will print "Mismatch", and further executions will print the content of "str1" and the word "Equal" as expected. But if I make it run form the scheduler the global variable str1 will always be empty. It looks like it's destroy after each execution. I
Anyone having the same problem or I'm miss using the global variables?.