-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathros_sys_upgrade_worker.chr.conf
36 lines (30 loc) · 1.03 KB
/
ros_sys_upgrade_worker.chr.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
## Set Variables
:local UpdateChannel "stable";
:local DeviceName [/system identity get name ];
## Set Variables End
## Update RouterOS
:log info ("Checking RouterOS status ...")
/system package update
set channel=$UpdateChannel
check-for-updates
# Wait on slow connections
:delay 60s;
:local SystemVer [/system package update get installed-version ];
:local UpstreamVer [/system package update get latest-version ];
:local Status [/system package update get status ];
:local Channel [/system package update get channel ];
:if ($SystemVer != $UpstreamVer) do={
# New version of RouterOS available
:log info ("$DeviceName can be updated from $SystemVer to $UpstreamVer ( channel: $Channel )")
:log info ("Preparing to update RouterOS")
# Wait for system email log timer
:delay 210s;
:log info ("Start updating :) ")
:delay 90s;
install
} else={
# No RouterOS update available, nothing to do, just log info
:log info ("RouterOS of $DeviceName is $SystemVer")
:log info ("$Status")
}
## Update RouterOS End