mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-07-31 16:24:30 +02:00
global-functions: $MailServerIsUp: handle resolve errors
This commit is contained in:
parent
215bf78ce1
commit
255b2a8244
1 changed files with 6 additions and 1 deletions
|
@ -338,7 +338,12 @@
|
||||||
$LogPrintExit warning ("Adding netwatch entry for mail server.") false;
|
$LogPrintExit warning ("Adding netwatch entry for mail server.") false;
|
||||||
:local MailHost $MailServer;
|
:local MailHost $MailServer;
|
||||||
:if ([ :typeof [ :toip $MailHost ] ] != "ip" ) do={
|
:if ([ :typeof [ :toip $MailHost ] ] != "ip" ) do={
|
||||||
:set MailHost [ :resolve $MailServer ];
|
:do {
|
||||||
|
:set MailHost [ :resolve $MailServer ];
|
||||||
|
} on-error={
|
||||||
|
$LogPrintExit warning ("Resolving mail server failed.") false;
|
||||||
|
:return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/ tool netwatch add comment=$MailServer host=$MailHost;
|
/ tool netwatch add comment=$MailServer host=$MailHost;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue