aboutsummaryrefslogtreecommitdiffstats
path: root/update-gre-address
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-05-12 11:03:06 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-05-12 11:03:06 +0200
commit48f0a2d21118a7bff7d598e84d9f606fb30bf07a (patch)
treefb9746502335552880823e9445cd4201414bb8eb /update-gre-address
parent93ec9afe558ef6eba5d513fab359bb5f6618666d (diff)
parenta71a3d5466548d05d27d31c446c62afdf2412070 (diff)
Merge branch 'scripts' into ros-v7-path-syntax
Diffstat (limited to 'update-gre-address')
-rw-r--r--update-gre-address14
1 files changed, 7 insertions, 7 deletions
diff --git a/update-gre-address b/update-gre-address
index 475b30c..d1402e3 100644
--- a/update-gre-address
+++ b/update-gre-address
@@ -13,19 +13,19 @@
:global LogPrintExit2;
-/ interface gre set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
+/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
-:foreach Peer in=[ / ip ipsec active-peers find ] do={
- :local PeerVal [ / ip ipsec active-peers get $Peer ];
- :local GreInt [ / interface gre find where comment=$PeerVal->"id" ];
+:foreach Peer in=[ /ip/ipsec/active-peers/find ] do={
+ :local PeerVal [ /ip/ipsec/active-peers/get $Peer ];
+ :local GreInt [ /interface/gre/find where comment=$PeerVal->"id" ];
:if ([ :len $GreInt ] > 0) do={
- :local GreIntVal [ / interface gre get $GreInt ];
+ :local GreIntVal [ /interface/gre/get $GreInt ];
:if ([ :typeof ($PeerVal->"dynamic-address") ] = "str" && \
($PeerVal->"dynamic-address" != $GreIntVal->"remote-address" || \
$GreIntVal->"disabled" = true)) do={
$LogPrintExit2 info $0 ("Updating remote address for interface " . $GreIntVal->"name" . " to " . $PeerVal->"dynamic-address") false;
- / 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;
+ /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;
}
}
}