aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-07-10 11:22:25 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-07-10 11:45:20 +0200
commit12af69b443b24b54461c52cb8e3f69d83dcc6639 (patch)
treebe31b8bb2c7149f12c65f9775d04e11c05d9cb8e
parent13f091e5ae41cfac1c6e520949e2003032956479 (diff)
update-gre-address: handle missing dynamic address
-rw-r--r--update-gre-address6
1 files changed, 4 insertions, 2 deletions
diff --git a/update-gre-address b/update-gre-address
index 5842669..3050d8b 100644
--- a/update-gre-address
+++ b/update-gre-address
@@ -12,8 +12,10 @@
:local GreInt [ / interface gre find where comment=$PeerVal->"id" ];
:if ([ :len $GreInt ] > 0) do={
:local GreIntVal [ / interface gre get $GreInt ];
- :if ($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || $GreIntVal->"disabled" = true) do={
- :log info ("Update remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address");
+ :if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
+ ($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || \
+ $GreIntVal->"disabled" = true)) do={
+ :log info ("Updating remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address");
/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where remote-address=$PeerVal->"dynamic-address" name!=$GreIntVal->"name" ];
/ interface gre set $GreInt remote-address=($PeerVal->"dynamic-address") disabled=no;
}