Hi guys
I need to run the same script to resolve a number of host names in order for netwatch to work.
Am I correct in saying that I need to use local variables in order for there not to be some sort of clash?
Here’s my script.
{
:local "netwatch-host-name" "nippy"
:local "netwatch-dns-name" "nippy.dyndns.net"
:local "new-dns-ip" [:resolve $"netwatch-dns-name"]
:local "current-dns-ip" [/tool netwatch find comment=$"netwatch-dns-name" host]
:if ($"current-dns-ip" != $"new-dns-ip") do={ /tool netwatch set [find comment=$"netwatch-host-name"] host=$"new-dns-ip"}
}
and then script number two with a new variable name
{
:local "netwatch-host-name" "nippy1"
:local "netwatch-dns-name" "nippy1.dyndns.net"
:local "new-dns-ip" [:resolve $"netwatch-dns-name"]
:local "current-dns-ip" [/tool netwatch find comment=$"netwatch-dns-name" host]
:if ($"current-dns-ip" != $"new-dns-ip") do={ /tool netwatch set [find comment=$"netwatch-host-name"] host=$"new-dns-ip"}
}
I’m worried that the variable
"netwatch-host-name"
is the same for every script.
So essentially I need to resolve the ‘host’ name in netwatch every 30 seconds for a large number of dynamic DNS names.
Should I combine these in one big script or add them together?