Automating MikroTik RouterOS updates

Share your Config Push presets or discuss automation in general
Post Reply
User avatar
Tomas
Posts: 561
Joined: Sat Jun 25, 2016 12:33 pm

Thu May 03, 2018 1:13 am

We have a blog article on automating RouterOS upgrades:
https://unimus.net/blog/network-wide-mi ... grade.html

The article show how to setup a local RouterOS Package Source "server".
Unimus is then used to push package source configuration to the network, and tell the MikroTiks to update.

We will be puting out more blogs around automation (and other things) in the near future, stay tuned!

Any feedback is most welcome :)
User avatar
lweidig
Posts: 27
Joined: Fri Jan 12, 2018 4:43 pm

Fri May 25, 2018 4:08 pm

We are working on the RouterBoard upgrade part that was left at the end and wonder if the following will work, not knowing how your syste, is processing the commands.

Code: Select all

/system routerboard
:if ([get current-firmware] = [get upgrade-firmware]) \
do={:put "Versions match, skipping"} \
else={upgrade; \
y\
:delay 10;\
/system reboot;\
y\
}
The trick here is of course getting the system to respond to the two prompts that the upgrade / reboot generate. Thanks!
User avatar
Tomas
Posts: 561
Joined: Sat Jun 25, 2016 12:33 pm

Fri May 25, 2018 9:05 pm

You don't need to use "\" after each line.

Basically, Unimus works the same way as you would in the CLI.
So whatever series of commands works for you manually, will work through Mass Config Push in Unimus as well.

For example:

Code: Select all

/system routerboard
:if ([get current-firmware] = [get upgrade-firmware]) do={
:put "Versions match, skipping"
} else={
upgrade
y
:delay 10
/system reboot
y
}
Should work just fine.
Post Reply