aboutsummaryrefslogtreecommitdiffstats
path: root/check-routeros-update
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-11-26 23:02:15 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-11-26 23:04:05 +0100
commitca4e25283fa7a3c72d4b678cd0e5781f71cfed7e (patch)
tree87892cbd20b3f1d8911676c9cf15752b3b30ec47 /check-routeros-update
parentd09baddac30b8221ed34db41b9f0536daf83a084 (diff)
global-functions: clickable links in telegram notifications
Diffstat (limited to 'check-routeros-update')
-rw-r--r--check-routeros-update15
1 files changed, 6 insertions, 9 deletions
diff --git a/check-routeros-update b/check-routeros-update
index b8e87d9..a4dfe9d 100644
--- a/check-routeros-update
+++ b/check-routeros-update
@@ -48,13 +48,14 @@
:local NumInstalled [ $VersionToNum ($Update->"installed-version") ];
:local NumLatest [ $VersionToNum ($Update->"latest-version") ];
+:local Link ("https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree");
:if ($NumInstalled < $NumLatest) do={
:if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={
$LogPrintExit info ("Version " . $Update->"latest-version" . " is a patch release, updating...") false;
$SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \
("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \
- ", updating on " . $Identity . "...") "" "true";
+ ", updating on " . $Identity . "...") $Link "" "true";
$DoUpdate;
}
@@ -63,7 +64,7 @@
$LogPrintExit info ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false;
$SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \
("Seen a neighbor running version " . $Update->"latest-version" . " from " . $Update->"channel" . \
- ", updating on " . $Identity . "...") "" "true";
+ ", updating on " . $Identity . "...") $Link "" "true";
$DoUpdate;
}
@@ -80,7 +81,7 @@
$LogPrintExit info ("Version " . $Update->"latest-version" . " is considered safe, updating...") false;
$SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \
("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \
- ", updating on " . $Identity . "...") "" "true";
+ ", updating on " . $Identity . "...") $Link "" "true";
$DoUpdate;
}
}
@@ -102,9 +103,7 @@
$SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \
("A new RouterOS version " . ($Update->"latest-version") . \
" is available for " . $Identity . ".\n\n" . \
- [ $DeviceInfo ] . "\n\n" . \
- "https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree") \
- "" "true";
+ [ $DeviceInfo ]) $Link "" "true";
:set SentRouterosUpdateNotification ($Update->"latest-version");
}
@@ -117,9 +116,7 @@
$SendNotification ([ $SymbolForNotification "warning-sign" ] . "RouterOS version") \
("A different RouterOS version " . ($Update->"latest-version") . \
" is available for " . $Identity . ", but it is a downgrade.\n\n" . \
- [ $DeviceInfo ] . "\n\n" . \
- "https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree") \
- "" "true";
+ [ $DeviceInfo ]) $Link "" "true";
$LogPrintExit info ("A different RouterOS version " . ($Update->"latest-version") . \
" is available for downgrade.") false;
:set SentRouterosUpdateNotification ($Update->"latest-version");