aboutsummaryrefslogtreecommitdiffstats
path: root/ipv6-update.rsc
diff options
context:
space:
mode:
Diffstat (limited to 'ipv6-update.rsc')
-rw-r--r--ipv6-update.rsc16
1 files changed, 11 insertions, 5 deletions
diff --git a/ipv6-update.rsc b/ipv6-update.rsc
index ccc0eb9..c6e3d65 100644
--- a/ipv6-update.rsc
+++ b/ipv6-update.rsc
@@ -1,16 +1,17 @@
#!rsc by RouterOS
# RouterOS script: ipv6-update
-# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
-# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
+# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
+# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.14
+# requires RouterOS, version=7.15
#
# update firewall and dns settings on IPv6 prefix change
-# https://git.eworm.de/cgit/routeros-scripts/about/doc/ipv6-update.md
+# https://rsc.eworm.de/doc/ipv6-update.md
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
+:local ExitOK false;
:do {
:local ScriptName [ :jobname ];
@@ -22,16 +23,19 @@
:local PdPrefix $"pd-prefix";
:if ([ $ScriptLock $ScriptName ] = false) do={
+ :set ExitOK true;
:error false;
}
:if ([ :typeof $NaAddress ] = "str") do={
$LogPrint info $ScriptName ("An address (" . $NaAddress . ") was acquired, not a prefix. Ignoring.");
+ :set ExitOK true;
:error false;
}
:if ([ :typeof $PdPrefix ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from ipv6 dhcp-client.");
+ :set ExitOK true;
:error false;
}
@@ -90,4 +94,6 @@
}
}
}
-} on-error={ }
+} on-error={
+ :global ExitError; $ExitError $ExitOK [ :jobname ];
+}