diff options
author | Christian Hesse <mail@eworm.de> | 2021-04-27 21:53:28 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-04-28 13:58:37 +0200 |
commit | 8e1c524b8583aa476af232d2e2e2a19f5f34540c (patch) | |
tree | 09e6d5c887510da6d4acc16350b467d979a20844 /check-routeros-update | |
parent | fbe4c457c6c233e3dbe8e58c2d8d8eead9d9c091 (diff) |
check-routeros-update: pass origin to $SendNotification2
Diffstat (limited to 'check-routeros-update')
-rw-r--r-- | check-routeros-update | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/check-routeros-update b/check-routeros-update index 683f9be..0309730 100644 --- a/check-routeros-update +++ b/check-routeros-update @@ -65,7 +65,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; :if ($NumInstalled < $NumLatest) do={ :if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={ $LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is a patch release, updating...") false; - $SendNotification2 ({ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ message=("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; @@ -74,7 +75,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; :if ($SafeUpdateNeighbor = true && [ :len [ / ip neighbor find where \ version=($Update->"latest-version" . " (" . $Update->"channel" . ")") ] ] > 0) do={ $LogPrintExit2 info $0 ("Seen a neighbor running version " . $Update->"latest-version" . ", updating...") false; - $SendNotification2 ({ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ message=("Seen a neighbor running version " . $Update->"latest-version" . " from " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; @@ -91,7 +93,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; } :if ($Result->"status" = "finished" && $Result->"data" = $Update->"latest-version") do={ $LogPrintExit2 info $0 ("Version " . $Update->"latest-version" . " is considered safe, updating...") false; - $SendNotification2 ({ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ message=("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \ ", updating on " . $Identity . "..."); link=$Link; silent=true }); $DoUpdate; @@ -112,7 +115,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; $Update->"latest-version" . ".") true; } - $SendNotification2 ({ subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update"); \ message=("A new RouterOS version " . ($Update->"latest-version") . \ " is available for " . $Identity . ".\n\n" . \ [ $DeviceInfo ]); link=$Link; silent=true }); @@ -125,7 +129,8 @@ $LogPrintExit2 debug $0 ("Checking for updates...") false; $Update->"latest-version" . ".") true; } - $SendNotification2 ({ subject=([ $SymbolForNotification "warning-sign" ] . "RouterOS version"); \ + $SendNotification2 ({ origin=$0; \ + subject=([ $SymbolForNotification "warning-sign" ] . "RouterOS version"); \ message=("A different RouterOS version " . ($Update->"latest-version") . \ " is available for " . $Identity . ", but it is a downgrade.\n\n" . \ [ $DeviceInfo ]); link=$Link; silent=true }); |