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.
Code:Select all
{ :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"} }
Code:Select all
{ :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"} }
Code:Select all
"netwatch-host-name"
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?