With CAP "require same version" upgrade policy, how can I keep .npk files for APs, AUTOMATICALLY updated to same version (latest) before I update manager ?
Thanks
############# create ap file directory: "apdir"
############# create the update schedule:
/system scheduler
add name=AutoUpdate start-date=apr/25/1970 start-time=04:00:00 interval=1d on-event=Update
############# name the following script: "Update"
/system package update
check-for-updates once
:delay 3s;
:if ( [get status] = "New version is available") do={
:local newVer [get latest-version]
/tool fetch address="download.mikrotik.com" mode=https src-path="/routeros/$newVer/routeros-mipsbe-$newVer.npk" dst-path="/apdir"
/tool e-mail send to="user@domain" subject="Upgrading RouterOS on router $[/system identity get name]" body="Upgrading RouterOS on router $[/system identity get name] from $[/system package update get installed-version] to $[/system package update get latest-version] (channel:$[/system package update get channel])"
:delay 5s;
install
} else={
/system routerboard
:if ( [get current-firmware] != [get upgrade-firmware]) do={
/tool e-mail send to="user@domain" subject="Upgrading firmware on router $[/system identity get name]" body="Upgrading firmware on router $[/system identity get name] from $[/system routerboard get current-firmware] to $[/system routerboard get upgrade-firmware]"
:delay 5s;
upgrade
:delay 5s;
/system reboot
}
}