mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
update-tunnelbroker: get values into array
This commit is contained in:
parent
d9d98cfe9e
commit
cc9b2620e7
|
@ -19,11 +19,10 @@
|
||||||
:local PublicAddress [ / ip cloud get public-address ];
|
:local PublicAddress [ / ip cloud get public-address ];
|
||||||
|
|
||||||
:foreach Interface in=[ / interface 6to4 find where comment~"^tunnelbroker" !disabled ] do={
|
:foreach Interface in=[ / interface 6to4 find where comment~"^tunnelbroker" !disabled ] do={
|
||||||
:local IntName [ / interface 6to4 get $Interface name ];
|
:local InterfaceVal [ / interface 6to4 get $Interface ];
|
||||||
:local LastAddress [ / interface 6to4 get $Interface local-address ];
|
|
||||||
|
|
||||||
:if ($PublicAddress != $LastAddress) do={
|
:if ($PublicAddress != $InterfaceVal->"local-address") do={
|
||||||
:local Comment [ $ParseKeyValueStore [ / interface 6to4 get $Interface comment ] ];
|
:local Comment [ $ParseKeyValueStore ($InterfaceVal->"comment") ];
|
||||||
|
|
||||||
$CertificateAvailable "Starfield Secure Certificate Authority - G2";
|
$CertificateAvailable "Starfield Secure Certificate Authority - G2";
|
||||||
:log info ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress);
|
:log info ("Local address changed, sending UPDATE to tunnelbroker! New address: " . $PublicAddress);
|
||||||
|
@ -32,6 +31,6 @@
|
||||||
user=($Comment->"user") password=($Comment->"pass") keep-result=no;
|
user=($Comment->"user") password=($Comment->"pass") keep-result=no;
|
||||||
/ interface 6to4 set $Interface local-address=$PublicAddress;
|
/ interface 6to4 set $Interface local-address=$PublicAddress;
|
||||||
} else={
|
} else={
|
||||||
:log debug ("All tunnelbroker configuration is up to date for interface " . $IntName . ".");
|
:log debug ("All tunnelbroker configuration is up to date for interface " . $InterfaceVal->"name" . ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue