mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-04 02:04:39 +02:00
global-functions: introduce and use $DeviceInfo
This commit is contained in:
parent
23b38fa15a
commit
94581741f4
5 changed files with 41 additions and 47 deletions
|
@ -8,6 +8,7 @@
|
|||
:global SafeUpdateUrl;
|
||||
:global SentRouterosUpdateNotification;
|
||||
|
||||
:global DeviceInfo;
|
||||
:global SendNotification;
|
||||
|
||||
:local DoUpdate do={
|
||||
|
@ -36,9 +37,6 @@
|
|||
}
|
||||
|
||||
:if ($Update->"installed-version" != $Update->"latest-version") do={
|
||||
:local BoardName [ / system resource get board-name ];
|
||||
:local RouterBoard [ / system routerboard get ];
|
||||
|
||||
:if ([ :len $SafeUpdateUrl ] > 0) do={
|
||||
:local Result;
|
||||
:do {
|
||||
|
@ -74,13 +72,7 @@
|
|||
|
||||
$SendNotification ("RouterOS update") \
|
||||
("There is a RouterOS update available.\n\n" . \
|
||||
"Board name: " . $BoardName . "\n" . \
|
||||
"Model: " . $RouterBoard->"model" . "\n" . \
|
||||
"Serial number: " . $RouterBoard->"serial-number" . "\n" . \
|
||||
"Hostname: " . $Identity . "\n" . \
|
||||
"Channel: " . $Update->"channel" . "\n" . \
|
||||
"Installed: " . $Update->"installed-version" . "\n" . \
|
||||
"Available: " . $Update->"latest-version" . "\n\n" .\
|
||||
[ $DeviceInfo ] . "\n\n" . \
|
||||
"https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree") \
|
||||
"" "true";
|
||||
:set SentRouterosUpdateNotification ($Update->"latest-version");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue