mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-29 04:40:07 +02:00
dhcp-to-dns: use $CleanName
This commit is contained in:
parent
821dd02e5e
commit
c5714e5dc8
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
|||
:global Domain;
|
||||
:global Identity;
|
||||
|
||||
:global CharacterReplace;
|
||||
:global CleanName;
|
||||
:global EitherOr;
|
||||
:global IfThenElse;
|
||||
:global LogPrintExit2;
|
||||
|
@ -65,8 +65,8 @@ $ScriptLock $0 false 10;
|
|||
|
||||
:if ([ :len ($LeaseVal->"active-address") ] > 0) do={
|
||||
:local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server");
|
||||
:local MacDash [ $CharacterReplace ($LeaseVal->"active-mac-address") ":" "-" ];
|
||||
:local HostName [ $CharacterReplace [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] " " "" ];
|
||||
:local MacDash [ $CleanName ($LeaseVal->"active-mac-address") ];
|
||||
:local HostName [ $CleanName [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] ];
|
||||
:local Network [ /ip/dhcp-server/network/find where ($LeaseVal->"active-address") in address ];
|
||||
:local NetworkVal;
|
||||
:if ([ :len $Network ] > 0) do={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue