aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-05-15 20:34:33 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-05-15 20:34:33 +0200
commit255b2a8244cce98a0d5253b0b11ba0860a009425 (patch)
tree145931c2e5f8899b41dd276be5436cbbf85abf15 /global-functions
parent215bf78ce1dca7596629bd88793d0859c96ed24e (diff)
global-functions: $MailServerIsUp: handle resolve errors
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions7
1 files changed, 6 insertions, 1 deletions
diff --git a/global-functions b/global-functions
index 83d7b2a..bae9fd6 100644
--- a/global-functions
+++ b/global-functions
@@ -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;
}