System Upgrade upgrade-package-source Problem

Hi Guys,

Please help me, Is there a way to execute this line using API or any other option?

/system upgrade upgrade-package-source add address=xx.x.xx.xx user=admin
password
/system upgrade refresh
:delay 10
:if ([/system upgrade get [/system upgrade find source=xx.x.xx.xx] status]!=“installed”) do={/system upgrade download-all reboot-after-download=yes}

I’m currently using C#

I tried this using API
api.Send(“/system/script/add”);
api.Send(“=name=test”);
api.Send(“=source=/system upgrade upgrade-package-source add address=xx.x.xx.xx user=admin password /system upgrade refresh :delay 10 :if ([/system upgrade get [/system upgrade find source=xx.x.xx.xx] status]!=“installed”) do={/system upgrade download-all reboot-after-download=yes}”);
api.Send(“.tag=xxx”, true);

hopefully the script is inserted my problem is when I’m trying to execute that command also using API like this

api.Send(“/system/script/run”);
api.Send(“=.id=*1”);
api.Send(“.tag=xxx”, true);

my error is something like this
expected end of command (line 1 column 73)

we dont want to do this manually with hundreds of router because it is time consuming, I also tried using SSH in C# same error occured

any help will be appreciated

Thanks in advance :smiley:

Just to clarify, the following does not have an option for password ie → password=insertpwd. It only asks you for the password after the following has been executed -

/system upgrade upgrade-package-source add address=10.1.10.40 user=admin
password: <-asks here

If you copy/paste to the terminal with password on line 2, it works fine. We can’t seem to figure out how to either, 1. Duplicate that with the API or 2. Upload it as a script (can’t get the password on line2 of the script so it executes just like copy/paste to terminal) . We would prefer to do this using the API as it only needs to run once and we have so far been unsuccessful at either. Any comments are welcome.