also, with API, similarly fails… Below, I try to run a script to add an IP address, it returns " !done ", then I run a simple " /ip/address/print " and only the previously present address is shown…
I’m guessing you’re using windows (based on the .\curl.exe …). So the “shell escaping” is different for something like cmd.exe. So you can’t use the single quote to avoid inner escaping, so the --data part should be:
I would like to leverage the REST API to update containers running on my router but not a big fan of using credentials giving wide access to the device.
Instead, I would like to use a script but I would need to pass arguments (at least the tag of the image).
Is there a way anyone can think of, to pass arguments to a script via a REST API call ?
Perhaps you can do is write the entire script(e.g. with container start/stop/whatever) to /system/script via PUT, with argument generated/interpolated as a local variable within that script in the calling code. Use POST on /system/script/run, and finally use DELETE to remove the script with REST