now with ROS 7 long-term is time to update all from 6 to 7.
i’m updated all from 6 to 7.20.7 and all works fine.
i DON’T use mass update, because if have a bug or router i MUST run on all customer…
so for now i connect to first mikrotik, update. wait to reboot…. reboot again for routerboot… wait….
when first mikrotik works fine and i can reach him form internet (of course with rules only from my work static ip or VPN) i update second mikotik.. wait … reboot… wait…
but i’m boring to reboot twice (1 for routeros and 1 for routeboot)
and letting ROS to do the job without bothering with the custom script? The effect will be the same (after first reboot, routerboot gets upgraded ... the only (optional in vast majority of cases) thing to do afterwards is reboot. The reboot after routerboot upgrade is only necessary if there's some notable change in routerboot which prevents upgraded ROS to run properly (e.g. some piece of hardware is initialized improperly), but even then sometimes a cold boot is required (which can't be done without manual intervention on site).
The script do not work 100% of the times, because after the upgrade all features like set something on routerboard are disabled fot the new device-mode.
The script isn't well written. What's the purpose?
Paste it into the terminal AFTER the update?
Whatever happens, the script is poorly written.
The easiest way to reboot only once is to update the firmware BEFORE rebooting the device....
Leaving something that potentially causes your router board to reboot endlessly is a truly terrible idea, from ANY perspective...
Note that the first thing my script does (after the reboot) is delete itself to avoid any future complications...
for example, in your script, if RouterOS syntax change upgrade-firmware to update-firmware (just an example, but OFTEN happen),
voilà endless reboot....
On my script, if somewhere syntax change, the line is not runned at all...
Hm. I would have thought an invalid element would cause the script to error out, but apparently not. Thanks for the observation. I'm still thinking this can be mitigated by verifying the array elements and increasing the delay time to allow for manually stopping the script before it runs. The sweet spot between automation and manual processes is always a moving target.
Honestly, my solution is precise and does its job without any frills...
If the upgrade is done "by hand" or automatically,
all it takes is for the automation to insert the script BEFORE the update, and you'll definitely not have any problems...
I see the point. That said, complexity is a matter of perspective. Your solution is precise and elegant, but requires an external process to be invoked every time, which adds complexity of a sort. Mine is self-contained and doesn't require external automation but adds local complexity and, as you pointed out, needs to be carefully vetted as a result. I suppose it all depends on whether the upgrade automation is happening on-device or not.
In this case it seems like a human is passing all the devices around one by one...
But even in the case of automation, since the automation still has to do "something," it just needs to apply the script first.
How many other cases are there?
Either there's a human, who I think feeds a script (rather than clicking all the buttons—but even if they did, pasting the script into a newly opened terminal is a snap).
Or there's something "built-in" to the device that definitely does "something", and the script is the first,
or there's something that connects remotely, which will still send commands, also the script, not click anything...
So, either manually or automatically, applying the script is a snap.
Instead, I think leaving scheduled processes running "n" times is completely pointless.
Just as it would be pointless to check whether the firmware is up to date at every reboot:
If the auto-upgrade option is already set to "yes," it'll take care of that everytime...
What you could do: set auto-upgrade=yes and let ROS do the routerboot upgrade. But if you insist on automatic reboot, you could check if there's a comment in /system/routerboard/print saying that reboot is necessary.
A side note: as I already wrote, rebooting after routerboot upgrade is "cosmetic" in most cases. I've upgraded my device 25 days ago and I don't see any need to do the reboot. routerboot was upgraded, it'll be "activated" at next reboot ... which might be due to power blackout (if my power company decides to make it longer than around 15 minutes which is the actual autonomy of my UPS system).
But, as @rextended already wrote: if you're really anxious about running latest firmware and you don't like reboots, upgrade firmware prior to upgrading ROS. He already indicated the way of doing it (it's quite a few steps on at least two devices - ROS device being upgraded and management machine - and I'm pretty sure it can be scripted somehow. If you do it, then single reboot (the automatic one, executed by upgrader) will also activate the new routerboot.
I'm wondering how you do it...
Is there a script that checks and applies automatically,
or do you connect one device at a time, issuing commands via GUI or CLI?
In all three cases, it's a snap to send the script commands along with the rest of the commands...