mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-10 18:14:27 +02:00
global-functions: $MailServerIsUp: return gracefully on missing configuration
This commit is contained in:
parent
a0d1709244
commit
38a3ef9552
1 changed files with 11 additions and 0 deletions
|
@ -417,8 +417,19 @@
|
||||||
:set MailServerIsUp do={
|
:set MailServerIsUp do={
|
||||||
:local MailServer [ / tool e-mail get address ];
|
:local MailServer [ / tool e-mail get address ];
|
||||||
|
|
||||||
|
:global EmailGeneralTo;
|
||||||
|
|
||||||
:global LogPrintExit;
|
:global LogPrintExit;
|
||||||
|
|
||||||
|
:if ([ :len $EmailGeneralTo ] = 0) do={
|
||||||
|
:return true;
|
||||||
|
} else={
|
||||||
|
:if ($MailServer = "0.0.0.0") do={
|
||||||
|
$LogPrintExit warning ("No mail server is configured! Returning gracefully...") false;
|
||||||
|
:return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
:if ([ :len [ / tool netwatch find where comment=$MailServer ] ] = 0) do={
|
:if ([ :len [ / tool netwatch find where comment=$MailServer ] ] = 0) do={
|
||||||
$LogPrintExit warning ("Adding netwatch entry for mail server.") false;
|
$LogPrintExit warning ("Adding netwatch entry for mail server.") false;
|
||||||
:local MailHost $MailServer;
|
:local MailHost $MailServer;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue