aboutsummaryrefslogtreecommitdiffstats
path: root/update-tunnelbroker
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-07-25 13:25:12 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-07-25 14:22:08 +0200
commitcc9b2620e7674ce86660d2214be16cfa17bb0f15 (patch)
tree11f6ed38abf50d1d6b58d3fd79d0fa66e8bfc463 /update-tunnelbroker
parentd9d98cfe9ed5b9812e8910098a4f46d057ea127d (diff)
update-tunnelbroker: get values into array
Diffstat (limited to 'update-tunnelbroker')
-rw-r--r--update-tunnelbroker9
1 files changed, 4 insertions, 5 deletions
diff --git a/update-tunnelbroker b/update-tunnelbroker
index 4a8c797..c529d44 100644
--- a/update-tunnelbroker
+++ b/update-tunnelbroker
@@ -19,11 +19,10 @@
:local PublicAddress [ / ip cloud get public-address ];
:foreach Interface in=[ / interface 6to4 find where comment~"^tunnelbroker" !disabled ] do={
- :local IntName [ / interface 6to4 get $Interface name ];
- :local LastAddress [ / interface 6to4 get $Interface local-address ];
+ :local InterfaceVal [ / interface 6to4 get $Interface ];
- :if ($PublicAddress != $LastAddress) do={
- :local Comment [ $ParseKeyValueStore [ / interface 6to4 get $Interface comment ] ];
+ :if ($PublicAddress != $InterfaceVal->"local-address") do={
+ :local Comment [ $ParseKeyValueStore ($InterfaceVal->"comment") ];
$CertificateAvailable "Starfield Secure Certificate Authority - G2";
: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;
/ interface 6to4 set $Interface local-address=$PublicAddress;
} 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" . ".");
}
}