Script adding upgrade source

I am trying to do the command:

/system upgrade upgrade-package-source add address=172.17.1.1 user=updateuser but I would like to put the password in place so I don’t have to manually type it between each CPE radio.

Is there an option outside of using a binary backup?

You can paste your script into a terminal and just do like

/ system upgrade upgrade-package-source add address=1.2.3.4 user=“username”
password

/next command

Not ideal, but works..

-Gerard

Still required to hit enter, though, correct?

That’s what that extra blank line before the /next command does.. it hits that enter for you..

-Gerard

you can even save all these commands in a txt file, rename to RSC and import them with the “/import” command. and THEN you can also use the fetch command to get these files from remote locations :slight_smile: not so bad at all if you think of the possibilities

Normis,

Unfortunately you can’t specify the password for the “/system upgrade upgrade-package-source add” command from a script or on a single line in the console..

-Gerard

With that being the case, my solution is to copy/paste the commands but ending with

#after this command type the password Password1
/system upgrade upgrade-package-source add blah blah

Which will leave you with a Password: prompt.

Still not possible.
As mentioned by macsrwe here: Re: 6.30 released

Not super happy with having had to this manually on ~40 routers yesterday.

Test file: (test.rsc)

:log warning "Attempting import."
/system upgrade upgrade-package-source add address=192.168.1.1 user="admin"
blahblah

:log warning "Import successful!"

Command:

/import test.rsc

You can also see this if you try by making a script.
Code:

/system script
add name="Test" source=":log warning \"Attempting import.\"\r\n/system upgrade upgrade-package-source add address=192.168.1.1 user=\"admin\"\r\npassword\r\n\r\n:log warning \"Import successful!\"\r\n"
run "Test"

See also: http://forum.mikrotik.com/viewtopic.php?f=9&t=24555&p=535221#p535221

Found an interesting read on this subject.
It was said back in 2010 that you can set upgrade-package-source via the API.
Here: Re: upgrade-package-source

/system/upgrade/upgrade-package-source/add

I’ll have to test this when I have time.

EDIT 2021-11-23: Yeah I never got around to testing this.