mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-routeros-update: match version with date suffix
Neighbor version can have a date suffix. This changes to match only on the beginning. Closes: GH-45 Co-authored-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
parent
313e026229
commit
fbf55292a4
1 changed files with 2 additions and 1 deletions
|
@ -18,6 +18,7 @@
|
|||
:global SentRouterosUpdateNotification;
|
||||
|
||||
:global DeviceInfo;
|
||||
:global EscapeForRegEx;
|
||||
:global LogPrintExit2;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
|
@ -80,7 +81,7 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false;
|
|||
}
|
||||
|
||||
:if ($SafeUpdateNeighbor = true && [ :len [ /ip/neighbor/find where \
|
||||
version=($Update->"latest-version" . " (" . $Update->"channel" . ")") ] ] > 0) do={
|
||||
version~("^" . [ $EscapeForRegEx ($Update->"latest-version" . " (" . $Update->"channel" . ")") ]) ] ] > 0) do={
|
||||
$LogPrintExit2 info $0 ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false;
|
||||
$SendNotification2 ({ origin=$0; \
|
||||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||
|
|
Loading…
Reference in a new issue