Zkus - kontroluje i bios:
#
/system script
add name=AutoUpgrade owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive source="
:if ([/system routerboard get current-firmware] != [/system routerboard get upgrade-firmware]) do={
:log error \"Bios need upgrade\";
/system script add name=\"bios-upgrade\" source=\"/system routerboard upgrade\";
/system script run bios-upgrade;
:delay 5;
/system script remove [find name=bios-upgrade];\
:delay 5;\
/system reboot} else={:log warning \"Nothing\"}\
## Notification e-mail
:local email "aktualizace@email.cz"
########## Do the stuff
## Check for update
/system package update
set channel=current
check-for-updates
## Waint on slow connections
:delay 15s;
## Important note: "installed-version" was "current-version" on older Roter OSes
:if ([get installed-version] != [get latest-version]) do={
## New version of RouterOS available, let's upgrade
/tool e-mail send to="$email" 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])"
:log info ("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])")
## Wait for mail to be send & upgrade
:delay 15s;
## "install" command is reincarnation of the "upgrade" command - doing exactly the same but under a different name
install
} else={
## RouterOS latest, let's check for updated firmware
:log info ("No RouterOS upgrade found, checking for HW upgrade...")
/system routerboard
:if ( [get current-firmware] != [get upgrade-firmware]) do={
## New version of firmware available, let's upgrade
/tool e-mail send to="$email" 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]"
:log info ("Upgrading firmware on router $[/system identity get name] from $[/system routerboard get current-firmware] to $[/system routerboard get upgrade-firmware]")
## Wait for mail to be send & upgrade
:delay 300s;
upgrade
## Wait for upgrade, then reboot
:delay 180s;
/system reboot
} else={
:log info ("No Router HW upgrade found")
}
}