aboutsummaryrefslogtreecommitdiffstats
path: root/update-tunnelbroker.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'update-tunnelbroker.rsc')
-rw-r--r--update-tunnelbroker.rsc17
1 files changed, 12 insertions, 5 deletions
diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc
index 67a5d30..45afa6f 100644
--- a/update-tunnelbroker.rsc
+++ b/update-tunnelbroker.rsc
@@ -1,18 +1,20 @@
#!rsc by RouterOS
# RouterOS script: update-tunnelbroker
-# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
+# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
# Michael Gisbers <michael@gisbers.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
+# https://rsc.eworm.de/COPYING.md
#
# provides: ppp-on-up
-# requires RouterOS, version=7.14
+# requires RouterOS, version=7.15
+# requires device-mode, fetch
#
# update local address of tunnelbroker interface
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/update-tunnelbroker.md
+# https://rsc.eworm.de/doc/update-tunnelbroker.md
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
+:local ExitOK false;
:do {
:local ScriptName [ :jobname ];
@@ -22,11 +24,13 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
+ :set ExitOK true;
:error false;
}
:if ([ $CertificateAvailable "Starfield Root Certificate Authority - G2" ] = false) do={
$LogPrint error $ScriptName ("Downloading required certificate failed.");
+ :set ExitOK true;
:error false;
}
@@ -50,6 +54,7 @@
:if (!($Data ~ "^(good|nochg) ")) do={
$LogPrint error $ScriptName ("Failed sending the local address to tunnelbroker or unexpected response!");
+ :set ExitOK true;
:error false;
}
@@ -64,4 +69,6 @@
/interface/6to4/set $Interface local-address=$PublicAddress;
}
}
-} on-error={ }
+} on-error={
+ :global ExitError; $ExitError $ExitOK [ :jobname ];
+}