mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-02 17:24:51 +02:00
dhcp-to-dns: act on hostname only if available
This commit is contained in:
parent
395bc8c90f
commit
845c25f87c
1 changed files with 3 additions and 1 deletions
|
@ -49,7 +49,9 @@
|
|||
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ($DupMacLeases->([ :len $DupMacLeases ] - 1)) address ];
|
||||
}
|
||||
|
||||
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") dynamic=yes ]->0) address ];
|
||||
:if ([ :len ($LeaseVal->"host-name") ] > 0) do={
|
||||
:set ($LeaseVal->"address") [ / ip dhcp-server lease get ([ find where host-name=($LeaseVal->"host-name") dynamic=yes ]->0) address ];
|
||||
}
|
||||
|
||||
:if ($DnsIp = $LeaseVal->"address") do={
|
||||
:log debug ("DNS entry for " . $Fqdn . " does not need updating.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue