mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
dhcp-to-dns: put string into variable
This commit is contained in:
parent
ed1a6c5de9
commit
2ba389a2be
1 changed files with 5 additions and 4 deletions
|
@ -25,12 +25,13 @@
|
||||||
[ $IfThenElse ($HostNameInZone = true) ($Identity . ".") ] . $Domain);
|
[ $IfThenElse ($HostNameInZone = true) ($Identity . ".") ] . $Domain);
|
||||||
:local Ttl 5m;
|
:local Ttl 5m;
|
||||||
:local CommentPrefix "managed by dhcp-to-dns for ";
|
:local CommentPrefix "managed by dhcp-to-dns for ";
|
||||||
|
:local CommentString "--- dhcp-to-dns above ---";
|
||||||
|
|
||||||
:if ([ :len [ / ip dns static find where comment="--- dhcp-to-dns above ---" name=- type=NXDOMAIN disabled ] ] = 0) do={
|
:if ([ :len [ / ip dns static find where comment=$CommentString name=- type=NXDOMAIN disabled ] ] = 0) do={
|
||||||
/ ip dns static add comment="--- dhcp-to-dns above ---" name=- type=NXDOMAIN disabled=yes;
|
/ ip dns static add comment=$CommentString name=- type=NXDOMAIN disabled=yes;
|
||||||
$LogPrintExit2 warning $0 ("Added disabled static dns record with comment '--- dhcp-to-dns above ---'.") false;
|
$LogPrintExit2 warning $0 ("Added disabled static dns record with comment '" . $CommentString . "'.") false;
|
||||||
}
|
}
|
||||||
:local PlaceBefore ([ / ip dns static find where comment="--- dhcp-to-dns above ---" name=- type=NXDOMAIN disabled ]->0);
|
:local PlaceBefore ([ / ip dns static find where comment=$CommentString name=- type=NXDOMAIN disabled ]->0);
|
||||||
|
|
||||||
:foreach DnsRecord in=[ / ip dns static find where comment ~ $CommentPrefix ] do={
|
:foreach DnsRecord in=[ / ip dns static find where comment ~ $CommentPrefix ] do={
|
||||||
:local DnsRecordVal [ / ip dns static get $DnsRecord ];
|
:local DnsRecordVal [ / ip dns static get $DnsRecord ];
|
||||||
|
|
Loading…
Reference in a new issue