mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
dhcp-to-dns: use $CleanName
This commit is contained in:
parent
821dd02e5e
commit
c5714e5dc8
|
@ -16,7 +16,7 @@
|
||||||
:global Domain;
|
:global Domain;
|
||||||
:global Identity;
|
:global Identity;
|
||||||
|
|
||||||
:global CharacterReplace;
|
:global CleanName;
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global IfThenElse;
|
:global IfThenElse;
|
||||||
:global LogPrintExit2;
|
:global LogPrintExit2;
|
||||||
|
@ -65,8 +65,8 @@ $ScriptLock $0 false 10;
|
||||||
|
|
||||||
:if ([ :len ($LeaseVal->"active-address") ] > 0) do={
|
:if ([ :len ($LeaseVal->"active-address") ] > 0) do={
|
||||||
:local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server");
|
:local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server");
|
||||||
:local MacDash [ $CharacterReplace ($LeaseVal->"active-mac-address") ":" "-" ];
|
:local MacDash [ $CleanName ($LeaseVal->"active-mac-address") ];
|
||||||
:local HostName [ $CharacterReplace [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] " " "" ];
|
: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 Network [ /ip/dhcp-server/network/find where ($LeaseVal->"active-address") in address ];
|
||||||
:local NetworkVal;
|
:local NetworkVal;
|
||||||
:if ([ :len $Network ] > 0) do={
|
:if ([ :len $Network ] > 0) do={
|
||||||
|
|
Loading…
Reference in a new issue