Running scripts using MT API - the differences

Hi,

If I run a script which creates a global variable using MT API the variable doesn’t appear in the “/system/script/environment/print” MT API listing nor in “:environment print” CLI list.
I am using the MT API under admin account…

Is there a way how to solve the problem?
What are other difference when the script is started using MT API? I loks form like these scripts runs in some different context which prevents them to access/modify ‘public’ global variable space?


Regards
Dalibor Toman

going to look into it.

anyway, variables that are already in environment are accessible, just ones that should have been created as result of script executed through api are not for some kind of reason.

During an automated cfg upgrade I need to know when the upgrade is done. I am using a global variable which was updated by the import script on several places (to see the import progress). The problem is that if wifi params are being changed the script loses connection to the router board - then the scripts reconnect back to the board and need to check if the upgrade is already done or not (some older boards are very slow). If the import is started via SSH the global variable works fine for it. But I have problems with SSH on ROS 5.X so I am trying to use only MT API…

Thanks

newer versions of ssh should be fixed already, there where certain issues resolved that impacted speed of ssh command execution.

Anyway, we are looking into missing global variable problem.

OK, thanks for the info.
Anyway I am now using only MT API in my upgrade perl script whenever it is available (using SCP to file transfer). Instead of using a global variable I am modifying a Mikrotik script source code on the target box.