aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-01-31 15:29:54 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-01-31 23:10:15 +0100
commitc5714e5dc819ce00d550a749d46b023cbf37fef0 (patch)
treef125e905a3de421e88b3cb68c330b3aa191d6039
parent821dd02e5e5c5274ee5d80a742859447c2f79d17 (diff)
dhcp-to-dns: use $CleanName
-rw-r--r--dhcp-to-dns.rsc6
1 files changed, 3 insertions, 3 deletions
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={