I’m having problems with running a script from Python API. Lets say the script is called “temp”. Through Winbox terminal I’m running the script using following command: /system script run temp
According to manual, in API one should call the same script using:
/system/script/run
=name=temp
However, this call doesn’t work, I’m getting trap message “script not found”.
I’ve managed to call the script using:
/system/script/run
=.id=*6
However, this call is not practical - if you add additional scripts, ID changes and you have to update your API code…
Is it possible to call the script by the name parameter?
first, use latest RouterOS availabe or name on what version you are trying to run something.
second,
/system/script/run
=.id=script1
is running for me without problems. but do not consider that you will get any meaningful output into API, as API does not support any scripting constructs etc. Best shoot is to set up global variable that afterwards can be read from using API.