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?
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…
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.