Ok I have finally given up on this. When executing the /system upgrade upgrade-package-source cmd, it will prompt you for a
[admin@Mikrotik] > /system upgrade upgrade-package-source add address=1.1.1.1 user=mtupdate
password: <- THIS IS THE PART I AM HAVING TROUBLES SCRIPTING BELOW AND THERE IS NO SET PASSWORD OPTION
Here is the issue. There is no cmd to add/edit/anything the password during or after. This makes scripting the password impossible so far. You can only edit the name and the source. If you copy and paste -
/system upgrade upgrade-package-source add address=1.1.1.1 user=mtupdate
p4$$w0RD
into the terminal, this works fine. But put that same code into /system script and it does not work. Anyone have any ideas? Here is my current (not working) script where I attempted to use \r\n. I've tried several variations, including opening the created script in the gui and putting the password on line 2 -
/system script add name=pkgsource source={/system upgrade upgrade-package-source add address=1.1.1.1 user=mtupdate \r\n p4$$w0RD}
Here what I am trying to push from start to finish if anyone is interested. It basically adds 2 scripts. The first sets the auto update server, the second checks for firmware updates and installs if necessary. If you tell me I should just copy and paste in the cmd line, I'll tell you I'm dealing with over 300 routers so that's not an option, -
#Remove Package Source Entry
foreach i in=[/system upgrade upgrade-package-source find] do={/system upgrade upgrade-package-source remove $i;};
#Remove All Scripts
foreach i in=[/system script find] do={/system script remove $i;};
#Upgrade Package Source
/system script add name=pkgsource source={/system upgrade upgrade-package-source add address=1.1.1.1 user=mtupdate \r\n p4$$w0RD}
#Upgrade Script
/system script add name=upgrade source={/system upgrade refresh; :delay 10; :if ([/system upgrade get [/system upgrade find source=1.1.1.1] status]!="installed") do={/system upgrade download-all reboot-after-download=yes}}
#Run Upgrade Scripts
/system script run pkgsource
/system script run upgrade