mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
dhcp-to-dns: allow the matching separator string in name
This commit is contained in:
parent
3396aefac9
commit
3d589def7d
1 changed files with 4 additions and 4 deletions
|
@ -32,11 +32,11 @@ $ScriptLock $0 false 10;
|
|||
:local CommentPrefix ("managed by " . $0 . " for ");
|
||||
:local CommentString ("--- " . $0 . " above ---");
|
||||
|
||||
:if ([ :len [ /ip/dns/static/find where comment=$CommentString name=- type=NXDOMAIN disabled ] ] = 0) do={
|
||||
/ip/dns/static/add comment=$CommentString name=- type=NXDOMAIN disabled=yes;
|
||||
$LogPrintExit2 warning $0 ("Added disabled static dns record with comment '" . $CommentString . "'.") false;
|
||||
:if ([ :len [ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ] ] = 0) do={
|
||||
/ip/dns/static/add name=$CommentString type=NXDOMAIN disabled=yes;
|
||||
$LogPrintExit2 warning $0 ("Added disabled static dns record with name '" . $CommentString . "'.") false;
|
||||
}
|
||||
:local PlaceBefore ([ /ip/dns/static/find where comment=$CommentString name=- type=NXDOMAIN disabled ]->0);
|
||||
:local PlaceBefore ([ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ]->0);
|
||||
|
||||
:foreach DnsRecord in=[ /ip/dns/static/find where comment ~ $CommentPrefix ] do={
|
||||
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
||||
|
|
Loading…
Reference in a new issue