From df928ff796475a9c7f6fa9b8221f48494ef45e6d Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 13 Mar 2024 09:13:39 +0100 Subject: netwatch-notify: do not switch type when resolving This requires RouterOS 7.15beta4. --- netwatch-notify.rsc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'netwatch-notify.rsc') diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index 17682f0..8481314 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -3,7 +3,7 @@ # Copyright (c) 2020-2024 Christian Hesse # https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md # -# requires RouterOS, version=7.13 +# requires RouterOS, version=7.15beta4 # # monitor netwatch and send notifications # https://git.eworm.de/cgit/routeros-scripts/about/doc/netwatch-notify.md @@ -102,7 +102,8 @@ :if ([ :typeof ($HostInfo->"resolve") ] = "str") do={ :if ([ $IsDNSResolving ] = true) do={ :do { - :local Resolve [ :resolve ($HostInfo->"resolve") ]; + :local Resolve [ :resolve type=[ $IfThenElse ([ :typeof ($HostVal->"host" ] = "ip") \ + "ipv4" "ipv6" ] ($HostInfo->"resolve") ]; :if ($Resolve != $HostVal->"host") do={ :if ([ $ResolveExpected $ScriptName ($HostInfo->"resolve") ($HostVal->"host") ] = false) do={ $LogPrint info $ScriptName ("Name '" . $HostInfo->"resolve" . [ $IfThenElse \ -- cgit v1.2.3-54-g00ecf