mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-29 20:54:28 +02:00
dhcp-to-dns: use mac-address if hostname is empty
This commit is contained in:
parent
0a34f4c2c2
commit
a47aa45253
1 changed files with 3 additions and 0 deletions
|
@ -42,6 +42,9 @@
|
|||
:set DhcpIp [ / ip dhcp-server lease get $Lease address ];
|
||||
:local Comment ("managed by dhcp-to-dns for " . $Mac);
|
||||
:set HostName [ $CharacterReplace [ / ip dhcp-server lease get $Lease host-name ] " " "" ];
|
||||
:if ($HostName = "") do={
|
||||
:set HostName [ $CharacterReplace [ / ip dhcp-server lease get $Lease mac-address ] ":" "-" ];
|
||||
}
|
||||
|
||||
:if ([ :len $HostName ] > 0) do={
|
||||
:set Fqdn ($HostName . "." . $Zone);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue