update-gre-address: early exit with :exit

This commit is contained in:
Christian Hesse 2026-01-19 15:25:51 +01:00
parent 9848e6a4b2
commit 6ea74adcef
2 changed files with 4 additions and 6 deletions

View file

@ -3,13 +3,12 @@
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
# https://rsc.eworm.de/COPYING.md
#
# requires RouterOS, version=7.19
# requires RouterOS, version=7.22
#
# update gre interface remote address with dynamic address from
# ipsec remote peer
# https://rsc.eworm.de/doc/update-gre-address.md
:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@ -21,8 +20,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
:set ExitOK true;
:error false;
:exit;
}
/interface/gre/set remote-address=0.0.0.0 disabled=yes [ find where !running !disabled ];
@ -42,5 +40,5 @@
}
}
} do={
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
}