Wed Mar 09, 2016 4:40 pm
Tryed that, but I'm stuck at getting the hostname to match with the IP.
the script eather runs too fast, or I am missing something.
:if ($leaseBound = "1") do={
:local DhcpHostName "$[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name]";
:log error "Creating new DNS entry for $DhcpHostName -> $leaseActIP"
/ip dns static add address="$leaseActIP" name="$DhcpHostName" ttl=1d
} else={
:log error "Removing old DNS entry for $DhcpHostName -> $leaseActIP"
}
runnung the line from terminal
:local DhcpHostName "$[/ip dhcp-server lease get [find where active-mac-address=$leaseActMAC && active-address=$leaseActIP] host-name]";
with the MAC and IP in place of the variables, works fine
but this script returns an empty string.