From c5714e5dc819ce00d550a749d46b023cbf37fef0 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 31 Jan 2024 15:29:54 +0100 Subject: dhcp-to-dns: use $CleanName --- dhcp-to-dns.rsc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dhcp-to-dns.rsc') diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc index 8dccf35..a8ae466 100644 --- a/dhcp-to-dns.rsc +++ b/dhcp-to-dns.rsc @@ -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={ -- cgit v1.2.3-54-g00ecf