mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
ipsec-to-dns: strip "CN=" from peer's id
This commit is contained in:
parent
621154ab83
commit
bff6689b10
1 changed files with 3 additions and 2 deletions
|
@ -46,8 +46,9 @@
|
||||||
|
|
||||||
:foreach Peer in=[ /ip/ipsec/active-peers/find where !(dynamic-address=[]) ] do={
|
:foreach Peer in=[ /ip/ipsec/active-peers/find where !(dynamic-address=[]) ] do={
|
||||||
:local PeerVal [ /ip/ipsec/active-peers/get $Peer ];
|
:local PeerVal [ /ip/ipsec/active-peers/get $Peer ];
|
||||||
:local Comment ($CommentPrefix . $PeerVal->"id");
|
:local PeerId [ $CharacterReplace ($PeerVal->"id") "CN=" "" ];
|
||||||
:local HostName [ :pick ($PeerVal->"id") 0 [ :find ($PeerVal->"id" . ".") "." ] ];
|
:local Comment ($CommentPrefix . $PeerId);
|
||||||
|
:local HostName [ :pick $PeerId 0 [ :find ($PeerId . ".") "." ] ];
|
||||||
|
|
||||||
:local Fqdn ($HostName . "." . $Zone);
|
:local Fqdn ($HostName . "." . $Zone);
|
||||||
:local DnsRecord [ /ip/dns/static/find where name=$Fqdn ];
|
:local DnsRecord [ /ip/dns/static/find where name=$Fqdn ];
|
||||||
|
|
Loading…
Reference in a new issue