mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 00:04:51 +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;
|
||||
:local MailHost $MailServer;
|
||||
: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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue