mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-04-16 18:19:36 +00:00
update-tunnelbroker: early exit with :exit
This commit is contained in:
parent
dab9f44ce0
commit
0285e7d1a1
2 changed files with 6 additions and 10 deletions
|
|
@ -4,7 +4,7 @@ Update tunnelbroker configuration
|
|||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://mikrotik.com/download/changelogs/)
|
||||
[](https://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,12 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: ppp-on-up
|
||||
# requires RouterOS, version=7.19
|
||||
# requires RouterOS, version=7.22
|
||||
# requires device-mode, fetch
|
||||
#
|
||||
# update local address of tunnelbroker interface
|
||||
# https://rsc.eworm.de/doc/update-tunnelbroker.md
|
||||
|
||||
:local ExitOK false;
|
||||
:onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
|
|
@ -24,14 +23,12 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:if ([ $CertificateAvailable "Starfield Root Certificate Authority - G2" "fetch" ] = false) do={
|
||||
$LogPrint error $ScriptName ("Downloading required certificate failed.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:foreach Interface in=[ /interface/6to4/find where comment~"^tunnelbroker" !disabled ] do={
|
||||
|
|
@ -54,8 +51,7 @@
|
|||
|
||||
:if (!($Data ~ "^(good|nochg) ")) do={
|
||||
$LogPrint error $ScriptName ("Failed sending the local address to tunnelbroker or unexpected response!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
|
||||
:local PublicAddress [ :pick $Data ([ :find $Data " " ] + 1) [ :find $Data "\n" ] ];
|
||||
|
|
@ -70,5 +66,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue