1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

netwatch-notify: also support the name from property

This commit is contained in:
Christian Hesse
2022-07-05 16:36:00 +02:00
parent 5767fceb39
commit 8e6eff30db

View File

@ -12,6 +12,7 @@
:global NetwatchNotify;
:global EitherOr;
:global IfThenElse;
:global IsDNSResolving;
:global LogPrintExit2;
@ -61,7 +62,7 @@ $ScriptLock $0;
:local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ];
:if ($HostInfo->"notify" = true && $HostInfo->"disabled" != true) do={
:local Name ($HostInfo->"name");
:local Name [ $EitherOr ($HostInfo->"name") ($HostVal->"name") ];
:local Metric { "count"=0; "notified"=false };
:if ([ :typeof ($NetwatchNotify->$Name) ] = "array") do={