mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
global-functions: drop support for attachment in notification e-mail
This commit is contained in:
parent
e7c2a7745a
commit
17d7678e2d
6 changed files with 12 additions and 15 deletions
|
@ -98,7 +98,7 @@ $WaitFullyConnected;
|
|||
"Fingerprint: " . ($CertNewVal->"fingerprint") . "\n" . \
|
||||
"Issuer: " . ([ $ParseKeyValueStore ($CertNewVal->"issuer") ]->"CN") . "\n" . \
|
||||
"Validity: " . ($CertNewVal->"invalid-before") . " to " . ($CertNewVal->"invalid-after") . "\n" . \
|
||||
"Expires in: " . [ $FormatExpire ($CertNewVal->"expires-after") ]) "" "" "true";
|
||||
"Expires in: " . [ $FormatExpire ($CertNewVal->"expires-after") ]) "" "true";
|
||||
$LogPrintExit info ("The certificate " . ($CertVal->"name") . " has been renewed.") false;
|
||||
} on-error={
|
||||
$LogPrintExit debug ("Could not renew certificate " . ($CertVal->"name") . ".") false;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
"LTE interface " . $IntName . " on " . $Identity . ".\n\n" . \
|
||||
"Interface: " . [ $CharacterReplace ($Info->"manufacturer" . " " . $Info->"model") ("\"") "" ] . "\n" . \
|
||||
"Installed: " . ($Firmware->"installed") . "\n" . \
|
||||
"Available: " . ($Firmware->"latest")) "" "" "true";
|
||||
"Available: " . ($Firmware->"latest")) "" "true";
|
||||
:set SentLteFirmwareUpgradeNotification ($Firmware->"latest");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
$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 . "...") $Link "" "true";
|
||||
", updating on " . $Identity . "...") $Link "true";
|
||||
$DoUpdate;
|
||||
}
|
||||
|
||||
|
@ -64,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 . "...") $Link "" "true";
|
||||
", updating on " . $Identity . "...") $Link "true";
|
||||
$DoUpdate;
|
||||
}
|
||||
|
||||
|
@ -81,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 . "...") $Link "" "true";
|
||||
", updating on " . $Identity . "...") $Link "true";
|
||||
$DoUpdate;
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@
|
|||
$SendNotification ([ $SymbolForNotification "sparkles" ] . "RouterOS update") \
|
||||
("A new RouterOS version " . ($Update->"latest-version") . \
|
||||
" is available for " . $Identity . ".\n\n" . \
|
||||
[ $DeviceInfo ]) $Link "" "true";
|
||||
[ $DeviceInfo ]) $Link "true";
|
||||
:set SentRouterosUpdateNotification ($Update->"latest-version");
|
||||
}
|
||||
|
||||
|
@ -116,7 +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 ]) $Link "" "true";
|
||||
[ $DeviceInfo ]) $Link "true";
|
||||
$LogPrintExit info ("A different RouterOS version " . ($Update->"latest-version") . \
|
||||
" is available for downgrade.") false;
|
||||
:set SentRouterosUpdateNotification ($Update->"latest-version");
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
[ $DeviceInfo ] . "\n\n" . \
|
||||
"Name: " . $Cloud->"name" . "\n" . \
|
||||
"Size: " . $Cloud->"size" . " B (" . ($Cloud->"size" / 1024) . " KiB)\n" . \
|
||||
"Download key: " . $Cloud->"secret-download-key") "" "" "true";
|
||||
"Download key: " . $Cloud->"secret-download-key") "" "true";
|
||||
} on-error={
|
||||
$SendNotification ([ $SymbolForNotification "warning-sign" ] . "Cloud backup failed") \
|
||||
("Failed uploading backup for " . $Identity . " to cloud!\n\n" . [ $DeviceInfo ]);
|
||||
|
|
|
@ -773,7 +773,6 @@
|
|||
:local Subject [ :tostr $1 ];
|
||||
:local Message [ :tostr $2 ];
|
||||
:local Link [ :tostr $3 ];
|
||||
:local Attach [ :tostr $4 ];
|
||||
|
||||
:global Identity;
|
||||
:global EmailGeneralTo;
|
||||
|
@ -792,8 +791,7 @@
|
|||
subject=("[" . $Identity . "] " . $Subject) \
|
||||
body=($Message . \
|
||||
[ $IfThenElse ([ :len $Link ] > 0) ("\n\n" . $Link) "" ] . \
|
||||
[ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]) \
|
||||
file=$Attach;
|
||||
[ $IfThenElse ([ :len $Signature ] > 0) ("\n-- \n" . $Signature) "" ]);
|
||||
} on-error={
|
||||
$LogPrintExit warning ("Failed sending notification mail!") false;
|
||||
}
|
||||
|
@ -805,13 +803,12 @@
|
|||
:local Subject [ :tostr $1 ];
|
||||
:local Message [ :tostr $2 ];
|
||||
:local Link [ :tostr $3 ];
|
||||
:local Attach [ :tostr $4 ];
|
||||
:local Silent [ :tostr $5 ];
|
||||
:local Silent [ :tostr $4 ];
|
||||
|
||||
:global SendEMail;
|
||||
:global SendTelegram;
|
||||
|
||||
$SendEMail $Subject $Message $Link $Attach;
|
||||
$SendEMail $Subject $Message $Link;
|
||||
$SendTelegram $Subject $Message $Link $Silent;
|
||||
}
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ $SendNotification [ $IfThenElse ($Failed > 0) \
|
|||
("Backup and config export upload for " . $Identity . ".\n\n" . \
|
||||
[ $DeviceInfo ] . "\n\n" . \
|
||||
"Backup file: " . $BackupFile . "\n" . \
|
||||
"Config file: " . $ConfigFile) "" "" "true";
|
||||
"Config file: " . $ConfigFile) "" "true";
|
||||
|
||||
:if ($Failed = 1) do={
|
||||
:error "An error occured!";
|
||||
|
|
Loading…
Reference in a new issue