aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-07-05 16:36:00 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-07-06 11:37:02 +0200
commit8e6eff30db8197e11cc47d6ca7f0752c63d1f0a1 (patch)
tree87841b6bc3713c54f40fc5cc61aff9a5388bdd58
parent5767fceb393a51690920e4c2df02916409bab03f (diff)
netwatch-notify: also support the name from property
-rw-r--r--netwatch-notify3
1 files changed, 2 insertions, 1 deletions
diff --git a/netwatch-notify b/netwatch-notify
index 445e329..c7575ea 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -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={