aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify.rsc
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-02-28 22:29:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-02-28 23:01:43 +0100
commita924de274c482b79777d9c1ca9d2e1d1919155cb (patch)
tree6aa3ae44b4a5a3fa575446e5ff04eeefa90d9056 /netwatch-notify.rsc
parent6f29c640e4e63b6a5e0d986b63dafa54dc2cc3fa (diff)
netwatch-notify: handle CNAME to multiple records
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r--netwatch-notify.rsc9
1 files changed, 9 insertions, 0 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index 1b6a005..cd4fc0d 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -62,6 +62,15 @@
:return true;
}
+ :local Cname [ /ip/dns/cache/find where name=$Name type="CNAME" ];
+ :if ([ :len $Cname ] > 0) do={
+ :set Cname [ /ip/dns/cache/get $Cname data ];
+ :set Cname [ :pick $Cname 0 ([ :len $Cname ] - 1) ];
+ :if ([ :len [ /ip/dns/cache/find where name=$Cname data=$Expected ] ] > 0) do={
+ :return true;
+ }
+ }
+
:return false;
}