It requests all the script names where the name = “miapi”.
So ROS returns “miapi” if that script exists.
But your code does nothing with that return data.
You can delete those lines or comment them out so you can refer back.
Also, keep in mind that the value of .id can change from device to device and also if you delete the script and re-add it. It all depends on where in the database sequence the script was added.
is possible get details such as config and wireless info from one mikrotik to another mikrotik…
by using scripts.
actually i have one gsm modem connected with the router.
im going to use sms receiving option to get mikrotik info to my mobile fone.
it is not possible to connect all router to seperate gsm modem.
give me a valid solution for it…
thanks in advance
You probably should’ve started a separate topic, but anyway…
In my opinion, the best thing to do is use the API to connect to both the router you want to take data from and the router you want to transfer data to. Last I checked, there isn’t a way to have the router initiate a script as soon as it receives an SMS, although you can check at regular intervals, and activate a transferring procedure then. You can use RouterOS’ scheduler that would activate the API syncing program OR you can simply set the API syncing program to run on schedule, and only connect to the other routers if an SMS has been received.
I want to write php script which is equivalent to this:
/system script run [find name="myscript"]
I mean, I want to execute script on routerboard, but I want to use name of script instead of its id. But I’m really new to ros api and php..
I’d like to ask for some help =) Is there any way to interpret the command above? Or I should parse the output of
well, i tested that on 5.20 and 5.21 (testing build) and it did execute the script via name. You will not see any results in API of script running, except script does something that you can check, like, set comment field.
Also, if you disconnect too fast, you might terminate session before command is executed. because router can accept commands one after another and return output when done.