diff --git a/BRANCHES.md b/BRANCHES.md
index b671e4c0..acd74358 100644
--- a/BRANCHES.md
+++ b/BRANCHES.md
@@ -4,7 +4,7 @@ Installing from branches
[](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)
diff --git a/CERTIFICATES.d/01-dialog-A.avif b/CERTIFICATES.d/01-dialog-A.avif
index 2fc3c9bd..ec5eb968 100644
Binary files a/CERTIFICATES.d/01-dialog-A.avif and b/CERTIFICATES.d/01-dialog-A.avif differ
diff --git a/CERTIFICATES.d/02-dialog-B.avif b/CERTIFICATES.d/02-dialog-B.avif
index 5e408abe..b2549c85 100644
Binary files a/CERTIFICATES.d/02-dialog-B.avif and b/CERTIFICATES.d/02-dialog-B.avif differ
diff --git a/CERTIFICATES.d/03-window.avif b/CERTIFICATES.d/03-window.avif
index 96039a3b..a588614e 100644
Binary files a/CERTIFICATES.d/03-window.avif and b/CERTIFICATES.d/03-window.avif differ
diff --git a/CERTIFICATES.d/04-certificate.avif b/CERTIFICATES.d/04-certificate.avif
index e6663146..de5ea9f9 100644
Binary files a/CERTIFICATES.d/04-certificate.avif and b/CERTIFICATES.d/04-certificate.avif differ
diff --git a/CERTIFICATES.md b/CERTIFICATES.md
index 8ebd861e..d6b4a257 100644
--- a/CERTIFICATES.md
+++ b/CERTIFICATES.md
@@ -4,7 +4,7 @@ Certificate name from browser
[](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)
@@ -32,13 +32,13 @@ is to use a desktop browser to get that information. This demonstration uses
[Mozilla Firefox âī¸](https://www.mozilla.org/firefox/).
Let's assume we want to make sure the certificate for
-[git.eworm.de](https://git.eworm.de/) is available. Open that page in the
-browser, then click the *lock* icon in addressbar, followed by "*Connection
-secure*".
+[rsc.eworm.de](https://rsc.eworm.de/) is available. Open that page in the
+browser, then click the *shield* icon in addressbar, followed by
+"*Connection secure*".

-The dialog will change, click "*More information*".
+The dialog will change, click "*More site information*".

diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md
index 1bce0fa1..cfbd4048 100644
--- a/CONTRIBUTIONS.md
+++ b/CONTRIBUTIONS.md
@@ -4,7 +4,7 @@ Past Contributions
[](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)
diff --git a/DEBUG.md b/DEBUG.md
index 38f82a11..1c95f068 100644
--- a/DEBUG.md
+++ b/DEBUG.md
@@ -4,7 +4,7 @@ Debug output and logs
[](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)
diff --git a/INITIAL-COMMANDS.md b/INITIAL-COMMANDS.md
index e033b576..b805a90e 100644
--- a/INITIAL-COMMANDS.md
+++ b/INITIAL-COMMANDS.md
@@ -4,7 +4,7 @@ Initial commands
[](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)
@@ -23,8 +23,7 @@ Run the complete base installation:
:local CertFingerprint "e14ffcad5b0025731006caa43a121a22d8e9700f4fb9cf852f02a708aa5d5666";
:local CertSettings [ /certificate/settings/get ];
- :if (!((($CertSettings->"builtin-trust-anchors") = "trusted" || \
- ($CertSettings->"builtin-trust-store") ~ "fetch" || \
+ :if (!((($CertSettings->"builtin-trust-store") ~ "fetch" || \
($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
:put "Importing certificate...";
diff --git a/README.md b/README.md
index b8f5b736..2c87acec 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ RouterOS Scripts
[](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)
@@ -50,7 +50,7 @@ temporarily.
> đĄī¸ **Hint**: If in doubt have a look at the badge at the top of each
> page showing the minimum version required:
-> 
+> 
> âšī¸ **Info**: The `main` branch is now RouterOS v7 only. If you are still
> running RouterOS v6 switch to `routeros-v6` branch!
@@ -113,10 +113,6 @@ least, but make sure not to drop other targets:

-> đĄī¸ **Hint**: With RouterOS 7.20.x and before the functionality was
-> different. Set the trust for the builtin trust anchors:
-> `/certificate/settings/set builtin-trust-anchors=trusted;`
-
You can skip the steps regarding *download and import certificate* and
jump to [installation of scripts](#installation-of-scripts) now.
diff --git a/accesslist-duplicates.capsman.rsc b/accesslist-duplicates.capsman.rsc
index cb194326..68cc7245 100644
--- a/accesslist-duplicates.capsman.rsc
+++ b/accesslist-duplicates.capsman.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# print duplicate antries in wireless access list
# https://rsc.eworm.de/doc/accesslist-duplicates.md
diff --git a/accesslist-duplicates.local.rsc b/accesslist-duplicates.local.rsc
index 4d545707..a2df90eb 100644
--- a/accesslist-duplicates.local.rsc
+++ b/accesslist-duplicates.local.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# print duplicate antries in wireless access list
# https://rsc.eworm.de/doc/accesslist-duplicates.md
diff --git a/accesslist-duplicates.template.rsc b/accesslist-duplicates.template.rsc
index 1e54fcd2..67ed60e5 100644
--- a/accesslist-duplicates.template.rsc
+++ b/accesslist-duplicates.template.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# print duplicate antries in wireless access list
# https://rsc.eworm.de/doc/accesslist-duplicates.md
diff --git a/accesslist-duplicates.wifi.rsc b/accesslist-duplicates.wifi.rsc
index 9a8892b8..1e4578bc 100644
--- a/accesslist-duplicates.wifi.rsc
+++ b/accesslist-duplicates.wifi.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# print duplicate antries in wireless access list
# https://rsc.eworm.de/doc/accesslist-duplicates.md
diff --git a/backup-cloud.rsc b/backup-cloud.rsc
index b4925f33..066ea854 100644
--- a/backup-cloud.rsc
+++ b/backup-cloud.rsc
@@ -4,12 +4,11 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: backup-script, order=40
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# upload backup to MikroTik cloud
# https://rsc.eworm.de/doc/backup-cloud.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -36,15 +35,13 @@
:if ([ $ScriptLock $ScriptName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -55,8 +52,7 @@
:if ([ $MkDir ("tmpfs/backup-cloud") ] = false) do={
$LogPrint error $ScriptName ("Failed creating directory!");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local I 5;
@@ -100,5 +96,5 @@
}
$RmDir "tmpfs/backup-cloud";
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/backup-email.rsc b/backup-email.rsc
index fcafff45..6eb4ea16 100644
--- a/backup-email.rsc
+++ b/backup-email.rsc
@@ -4,12 +4,11 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: backup-script, order=20
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# create and email backup and config file
# https://rsc.eworm.de/doc/backup-email.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -41,28 +40,24 @@
:if ([ :typeof $SendEMail2 ] = "nothing") do={
$LogPrint error $ScriptName ("The module for sending notifications via e-mail is not installed.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ($BackupSendBinary != true && \
$BackupSendExport != true) do={
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ $ScriptLock $ScriptName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -82,8 +77,7 @@
:if ([ $MkDir $DirName ] = false) do={
$LogPrint error $ScriptName ("Failed creating directory!");
- :set ExitOK true;
- :error false;
+ :exit;
}
# binary backup
@@ -139,5 +133,5 @@
}
# do not remove the files here, as the mail is still queued!
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/backup-partition.rsc b/backup-partition.rsc
index 78f4cce1..1d8edb60 100644
--- a/backup-partition.rsc
+++ b/backup-partition.rsc
@@ -4,13 +4,12 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: backup-script, order=70
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, scheduler
#
# save configuration to fallback partition
# https://rsc.eworm.de/doc/backup-partition.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -45,22 +44,19 @@
:if ([ $ScriptLock $ScriptName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /partitions/find ] ] < 2) do={
$LogPrint error $ScriptName ("Device does not have a fallback partition.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:local ActiveRunning [ /partitions/find where active running ];
@@ -68,8 +64,7 @@
:if ([ :len $ActiveRunning ] < 1) do={
$LogPrint error $ScriptName ("Device is not running from active partition.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:local FallbackToName [ /partitions/get $ActiveRunning fallback-to ];
@@ -78,8 +73,7 @@
:if ([ :len $FallbackTo ] < 1) do={
$LogPrint error $ScriptName ("There is no inactive partition named '" . $FallbackToName . "'.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ /partitions/get $ActiveRunning version ] != [ /partitions/get $FallbackTo version]) do={
@@ -88,8 +82,7 @@
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
:if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
}
} else={
@@ -101,8 +94,7 @@
($NumInstalled & $BitMask) != ($NumLatest & $BitMask)) do={
:if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
}
}
@@ -120,9 +112,8 @@
$LogPrint error $ScriptName ("Failed saving configuration to partition '" . \
$FallbackToName . "': " . $Err);
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/backup-upload.rsc b/backup-upload.rsc
index bded570c..52ff3587 100644
--- a/backup-upload.rsc
+++ b/backup-upload.rsc
@@ -4,13 +4,12 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: backup-script, order=50
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch
#
# create and upload backup and config file
# https://rsc.eworm.de/doc/backup-upload.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -47,21 +46,18 @@
:if ($BackupSendBinary != true && \
$BackupSendExport != true) do={
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ $ScriptLock $ScriptName ] = false) do={
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
:set PackagesUpdateBackupFailure true;
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -81,8 +77,7 @@
:if ([ $MkDir $DirName ] = false) do={
$LogPrint error $ScriptName ("Failed creating directory!");
- :set ExitOK true;
- :error false;
+ :exit;
}
# binary backup
@@ -174,5 +169,5 @@
}
$RmDir $DirName;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-download-packages.capsman.rsc b/capsman-download-packages.capsman.rsc
index 8cedf01b..5cb25d11 100644
--- a/capsman-download-packages.capsman.rsc
+++ b/capsman-download-packages.capsman.rsc
@@ -4,14 +4,13 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# download and cleanup packages for CAP installation from CAPsMAN
# https://rsc.eworm.de/doc/capsman-download-packages.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -28,8 +27,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -39,16 +37,14 @@
:if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!");
- :set ExitOK true;
- :error false;
+ :exit;
}
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!");
@@ -89,5 +85,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-download-packages.template.rsc b/capsman-download-packages.template.rsc
index ffb622ba..e29a0849 100644
--- a/capsman-download-packages.template.rsc
+++ b/capsman-download-packages.template.rsc
@@ -4,7 +4,7 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# download and cleanup packages for CAP installation from CAPsMAN
# https://rsc.eworm.de/doc/capsman-download-packages.md
@@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -29,8 +28,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -41,16 +39,14 @@
:if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!");
- :set ExitOK true;
- :error false;
+ :exit;
}
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!");
@@ -100,5 +96,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-download-packages.wifi.rsc b/capsman-download-packages.wifi.rsc
index 1aefee63..5f1865e8 100644
--- a/capsman-download-packages.wifi.rsc
+++ b/capsman-download-packages.wifi.rsc
@@ -4,14 +4,13 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# download and cleanup packages for CAP installation from CAPsMAN
# https://rsc.eworm.de/doc/capsman-download-packages.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -28,8 +27,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -39,16 +37,14 @@
:if ([ :len $PackagePath ] = 0) do={
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ $FileGet $PackagePath ] = false) do={
:if ([ $MkDir $PackagePath ] = false) do={
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
$PackagePath . ") failed!");
- :set ExitOK true;
- :error false;
+ :exit;
}
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
"). Please place your packages!");
@@ -91,5 +87,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-rolling-upgrade.capsman.rsc b/capsman-rolling-upgrade.capsman.rsc
index caa768d8..a56e4c93 100644
--- a/capsman-rolling-upgrade.capsman.rsc
+++ b/capsman-rolling-upgrade.capsman.rsc
@@ -5,14 +5,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: capsman-rolling-upgrade.capsman
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# upgrade CAPs one after another
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -23,8 +22,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local InstalledVersion [ /system/package/update/get installed-version ];
@@ -46,5 +44,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-rolling-upgrade.template.rsc b/capsman-rolling-upgrade.template.rsc
index d38cdda9..88a72dd5 100644
--- a/capsman-rolling-upgrade.template.rsc
+++ b/capsman-rolling-upgrade.template.rsc
@@ -5,7 +5,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: capsman-rolling-upgrade%TEMPL%
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# upgrade CAPs one after another
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
@@ -13,7 +13,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -24,8 +23,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local InstalledVersion [ /system/package/update/get installed-version ];
@@ -54,5 +52,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/capsman-rolling-upgrade.wifi.rsc b/capsman-rolling-upgrade.wifi.rsc
index 330ec04d..328356f7 100644
--- a/capsman-rolling-upgrade.wifi.rsc
+++ b/capsman-rolling-upgrade.wifi.rsc
@@ -5,14 +5,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: capsman-rolling-upgrade.wifi
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# upgrade CAPs one after another
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -23,8 +22,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local InstalledVersion [ /system/package/update/get installed-version ];
@@ -47,5 +45,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/certificate-renew-issued.rsc b/certificate-renew-issued.rsc
index e78669f4..46efabf7 100644
--- a/certificate-renew-issued.rsc
+++ b/certificate-renew-issued.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# renew locally issued certificates
# https://rsc.eworm.de/doc/certificate-renew-issued.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -22,8 +21,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Cert in=[ /certificate/find where issued expires-after<3w ] do={
@@ -48,5 +46,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/check-certificates.rsc b/check-certificates.rsc
index 7e2fed04..967c7902 100644
--- a/check-certificates.rsc
+++ b/check-certificates.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch
#
# check for certificate validity
# https://rsc.eworm.de/doc/check-certificates.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -159,8 +158,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -173,7 +171,7 @@
:do {
:if ([ :len $CertRenewUrl ] = 0) do={
$LogPrintOnce info $ScriptName ("No CertRenewUrl given.");
- :error false;
+ :break;
}
$LogPrint info $ScriptName ("Attempting to renew certificate '" . ($CertVal->"name") . "'.");
@@ -262,5 +260,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/check-health.d/state.rsc b/check-health.d/state.rsc
index 0728b45e..10a04f26 100644
--- a/check-health.d/state.rsc
+++ b/check-health.d/state.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check for RouterOS health state - state plugin
# https://rsc.eworm.de/doc/check-health.md
diff --git a/check-health.d/temperature.rsc b/check-health.d/temperature.rsc
index fdce5dcb..9ad35ae0 100644
--- a/check-health.d/temperature.rsc
+++ b/check-health.d/temperature.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check for RouterOS health state - temperature plugin
# https://rsc.eworm.de/doc/check-health.md
diff --git a/check-health.d/voltage.rsc b/check-health.d/voltage.rsc
index 67febc2b..b6c1afa7 100644
--- a/check-health.d/voltage.rsc
+++ b/check-health.d/voltage.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check for RouterOS health state - voltage plugin
# https://rsc.eworm.de/doc/check-health.md
diff --git a/check-health.rsc b/check-health.rsc
index 51438966..c82d8351 100644
--- a/check-health.rsc
+++ b/check-health.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check for RouterOS health state
# https://rsc.eworm.de/doc/check-health.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -37,8 +36,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Resource [ /system/resource/get ];
@@ -77,8 +75,7 @@
:local Plugins [ /system/script/find where name~"^check-health\\.d/." ];
:if ([ :len $Plugins ] = 0) do={
$LogPrint debug $ScriptName ("No plugins installed.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:global CheckHealthPlugins ({});
@@ -106,5 +103,5 @@
:set CheckHealthPlugins;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/check-lte-firmware-upgrade.rsc b/check-lte-firmware-upgrade.rsc
index 2087075e..56dc1ee0 100644
--- a/check-lte-firmware-upgrade.rsc
+++ b/check-lte-firmware-upgrade.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check for LTE firmware upgrade, send notification
# https://rsc.eworm.de/doc/check-lte-firmware-upgrade.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -20,8 +19,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $SentLteFirmwareUpgradeNotification ] != "array") do={
@@ -103,5 +101,5 @@
$CheckInterface $ScriptName $Interface;
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/check-perpetual-license.rsc b/check-perpetual-license.rsc
index 21d63cad..7c81cd0c 100644
--- a/check-perpetual-license.rsc
+++ b/check-perpetual-license.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2025-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check perpetual license on CHR
# https://rsc.eworm.de/doc/check-perpetual-license.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -25,8 +24,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -34,8 +32,7 @@
:local License [ /system/license/get ];
:if ([ :typeof ($License->"deadline-at") ] != "str") do={
$LogPrint info $ScriptName ("This device does not have a perpetual license.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ :len ($License->"next-renewal-at") ] = 0 && ($License->"limited-upgrades") = true) do={
@@ -47,8 +44,7 @@
", can no longer update RouterOS on " . $Identity . "...") });
:set SentCertificateNotification "expired";
}
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ :totime ($License->"deadline-at") ] - 3w < [ :timestamp ]) do={
@@ -60,8 +56,7 @@
($License->"deadline-at") . " on " . $Identity . "...") });
:set SentCertificateNotification "warning";
}
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ :typeof $SentCertificateNotification ] = "str" && \
@@ -74,5 +69,5 @@
:set SentCertificateNotification;
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/check-routeros-update.rsc b/check-routeros-update.rsc
index bf3acd98..e6627e07 100644
--- a/check-routeros-update.rsc
+++ b/check-routeros-update.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# check for RouterOS update, send notification and/or install
# https://rsc.eworm.de/doc/check-routeros-update.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -47,14 +46,12 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -65,8 +62,7 @@
/system/scheduler/remove "_RebootForUpdate";
} else={
$LogPrint info $ScriptName ("A reboot for update is already scheduled.");
- :set ExitOK true;
- :error false;
+ :exit;
}
}
@@ -78,14 +74,12 @@
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
$LogPrint info $ScriptName ("System is already up to date.");
}
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ :len ($Update->"latest-version") ] = 0) do={
$LogPrint info $ScriptName ("Received an empty version string from server.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local NumInstalled [ $VersionToNum ($Update->"installed-version") ];
@@ -97,8 +91,7 @@
:if ($NumLatest < [ $VersionToNum "7.0" ]) do={
$LogPrint warning $ScriptName ("The version '" . ($Update->"latest-version") . "' is not a valid version.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ($NumInstalled < $NumLatest) do={
@@ -110,8 +103,7 @@
message=("Installing ALL versions automatically, including " . $Update->"latest-version" . \
"... Updating on " . $Identity . "..."); link=$Link; silent=true });
$DoUpdate $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ($SafeUpdatePatch = true && $NumInstalledFeature = $NumLatestFeature) do={
@@ -121,8 +113,7 @@
message=("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \
", updating on " . $Identity . "..."); link=$Link; silent=true });
$DoUpdate $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ($SafeUpdateNeighbor = true) do={
@@ -137,8 +128,7 @@
message=("Seen a neighbor (" . $Neighbor . ") running version " . $Update->"latest-version" . \
" from " . $Update->"channel" . ", updating on " . $Identity . "..."); link=$Link; silent=true });
$DoUpdate $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
}
@@ -159,8 +149,7 @@
message=("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \
", updating on " . $Identity . "..."); link=$Link; silent=true });
$DoUpdate $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
}
@@ -170,16 +159,14 @@
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
/system/package/update/set channel=stable;
$LogPrint info $ScriptName ("Switched to channel 'stable', please re-run!");
- :set ExitOK true;
- :error true;
+ :exit;
}
}
:put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]");
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
$DoUpdate $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
} else={
:put "Canceled...";
}
@@ -188,8 +175,7 @@
:if ($SentRouterosUpdateNotification = $Update->"latest-version") do={
$LogPrint info $ScriptName ("Already sent the RouterOS update notification for version " . \
$Update->"latest-version" . ".");
- :set ExitOK true;
- :error true;
+ :exit;
}
$SendNotification2 ({ origin=$ScriptName; \
@@ -204,8 +190,7 @@
:if ($SentRouterosUpdateNotification = $Update->"latest-version") do={
$LogPrint info $ScriptName ("Already sent the RouterOS downgrade notification for version " . \
$Update->"latest-version" . ".");
- :set ExitOK true;
- :error true;
+ :exit;
}
$SendNotification2 ({ origin=$ScriptName; \
@@ -218,5 +203,5 @@
:set SentRouterosUpdateNotification ($Update->"latest-version");
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/collect-wireless-mac.capsman.rsc b/collect-wireless-mac.capsman.rsc
index 8bb33d87..4d55eb8c 100644
--- a/collect-wireless-mac.capsman.rsc
+++ b/collect-wireless-mac.capsman.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=40
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -30,8 +29,7 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@@ -96,5 +94,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/collect-wireless-mac.local.rsc b/collect-wireless-mac.local.rsc
index 9d41d420..3d65300f 100644
--- a/collect-wireless-mac.local.rsc
+++ b/collect-wireless-mac.local.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=40
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -30,8 +29,7 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /interface/wireless/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@@ -97,5 +95,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/collect-wireless-mac.template.rsc b/collect-wireless-mac.template.rsc
index 837726e3..c1b68ae2 100644
--- a/collect-wireless-mac.template.rsc
+++ b/collect-wireless-mac.template.rsc
@@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=40
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md
@@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -31,8 +30,7 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /caps-man/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@@ -114,5 +112,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/collect-wireless-mac.wifi.rsc b/collect-wireless-mac.wifi.rsc
index d07ff357..599b8fac 100644
--- a/collect-wireless-mac.wifi.rsc
+++ b/collect-wireless-mac.wifi.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=40
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# collect wireless mac adresses in access list
# https://rsc.eworm.de/doc/collect-wireless-mac.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -30,8 +29,7 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /interface/wifi/access-list/find where comment="--- collected above ---" disabled ] ] = 0) do={
@@ -96,5 +94,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/contrib/badges.md b/contrib/badges.md
index af4071c4..2b72ab64 100644
--- a/contrib/badges.md
+++ b/contrib/badges.md
@@ -1,6 +1,6 @@
[](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)
diff --git a/contrib/logo-color.d/browser-01.avif b/contrib/logo-color.d/browser-01.avif
index 3dc0a1f9..f758d1e7 100644
Binary files a/contrib/logo-color.d/browser-01.avif and b/contrib/logo-color.d/browser-01.avif differ
diff --git a/contrib/logo-color.d/browser-02.avif b/contrib/logo-color.d/browser-02.avif
index 1867fbe3..7679be16 100644
Binary files a/contrib/logo-color.d/browser-02.avif and b/contrib/logo-color.d/browser-02.avif differ
diff --git a/contrib/logo-color.d/browser-03.avif b/contrib/logo-color.d/browser-03.avif
index dc24bbbc..95732ad8 100644
Binary files a/contrib/logo-color.d/browser-03.avif and b/contrib/logo-color.d/browser-03.avif differ
diff --git a/contrib/logo-color.html b/contrib/logo-color.html
index 3e9c05fe..c39a20b8 100644
--- a/contrib/logo-color.html
+++ b/contrib/logo-color.html
@@ -45,7 +45,7 @@ logo and download it.

(This example is with
-Firefox. The workflow
+Mozilla Firefox âī¸. The workflow
for other browsers may differ.)
See how to
diff --git a/contrib/telegram.md b/contrib/telegram.md
index 36f7bc4e..76c88858 100644
--- a/contrib/telegram.md
+++ b/contrib/telegram.md
@@ -4,7 +4,7 @@ Telegram
[](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)
diff --git a/daily-psk.capsman.rsc b/daily-psk.capsman.rsc
index 2cee46ed..07603379 100644
--- a/daily-psk.capsman.rsc
+++ b/daily-psk.capsman.rsc
@@ -4,14 +4,13 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update daily PSK (pre shared key)
# https://rsc.eworm.de/doc/daily-psk.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -32,8 +31,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -92,5 +90,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/daily-psk.local.rsc b/daily-psk.local.rsc
index fbf6dafe..5e522e1b 100644
--- a/daily-psk.local.rsc
+++ b/daily-psk.local.rsc
@@ -4,14 +4,13 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update daily PSK (pre shared key)
# https://rsc.eworm.de/doc/daily-psk.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -32,8 +31,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -91,5 +89,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/daily-psk.template.rsc b/daily-psk.template.rsc
index 81244b86..1dfa89e2 100644
--- a/daily-psk.template.rsc
+++ b/daily-psk.template.rsc
@@ -4,7 +4,7 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update daily PSK (pre shared key)
# https://rsc.eworm.de/doc/daily-psk.md
@@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -33,8 +32,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -107,5 +105,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/daily-psk.wifi.rsc b/daily-psk.wifi.rsc
index 636e9f43..02feefb4 100644
--- a/daily-psk.wifi.rsc
+++ b/daily-psk.wifi.rsc
@@ -4,14 +4,13 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update daily PSK (pre shared key)
# https://rsc.eworm.de/doc/daily-psk.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -32,8 +31,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -92,5 +90,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/dhcp-lease-comment.capsman.rsc b/dhcp-lease-comment.capsman.rsc
index 7fd00a09..7038d461 100644
--- a/dhcp-lease-comment.capsman.rsc
+++ b/dhcp-lease-comment.capsman.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=60
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update dhcp-server lease comment with infos from access-list
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -22,8 +21,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
@@ -39,5 +37,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/dhcp-lease-comment.local.rsc b/dhcp-lease-comment.local.rsc
index 7ed6823a..c684d2e9 100644
--- a/dhcp-lease-comment.local.rsc
+++ b/dhcp-lease-comment.local.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=60
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update dhcp-server lease comment with infos from access-list
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -22,8 +21,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
@@ -39,5 +37,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/dhcp-lease-comment.template.rsc b/dhcp-lease-comment.template.rsc
index c901de40..4a2a5987 100644
--- a/dhcp-lease-comment.template.rsc
+++ b/dhcp-lease-comment.template.rsc
@@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=60
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update dhcp-server lease comment with infos from access-list
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
@@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -23,8 +22,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
@@ -44,5 +42,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/dhcp-lease-comment.wifi.rsc b/dhcp-lease-comment.wifi.rsc
index d481def8..1d522465 100644
--- a/dhcp-lease-comment.wifi.rsc
+++ b/dhcp-lease-comment.wifi.rsc
@@ -4,14 +4,13 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=60
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update dhcp-server lease comment with infos from access-list
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -22,8 +21,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Lease in=[ /ip/dhcp-server/lease/find where dynamic=yes status=bound ] do={
@@ -39,5 +37,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/dhcp-to-dns.rsc b/dhcp-to-dns.rsc
index 70567509..088c2dee 100644
--- a/dhcp-to-dns.rsc
+++ b/dhcp-to-dns.rsc
@@ -4,12 +4,11 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=20
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# check DHCP leases and add/remove/update DNS entries
# https://rsc.eworm.de/doc/dhcp-to-dns.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -28,8 +27,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Ttl 5m;
@@ -66,64 +64,72 @@
}
} on-error={
$LogPrint debug $ScriptName ("A lease just vanished, ignoring.");
+ :continue;
}
- :if ([ :len ($LeaseVal->"active-address") ] > 0) do={
- :local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server");
- :local MacDash [ $CleanName ($LeaseVal->"active-mac-address") ];
- :local HostName [ $CleanName [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] ];
- :local Network [ /ip/dhcp-server/network/find where ($LeaseVal->"active-address") in address ];
- :local NetworkVal;
- :if ([ :len $Network ] > 0) do={
- :set NetworkVal [ /ip/dhcp-server/network/get ($Network->0) ];
- }
- :local NetworkInfo [ $ParseKeyValueStore ($NetworkVal->"comment") ];
- :local NetDomain ([ $IfThenElse ([ :len ($NetworkInfo->"name-extra") ] > 0) ($NetworkInfo->"name-extra" . ".") ] . \
- [ $EitherOr [ $EitherOr ($NetworkInfo->"domain") ($NetworkVal->"domain") ] $Domain ]);
- :local FullA ($MacDash . "." . $NetDomain);
- :local FullCN ($HostName . "." . $NetDomain);
- :local MacInServer ($LeaseVal->"active-mac-address" . " in " . $LeaseVal->"server");
-
- :local DnsRecord [ /ip/dns/static/find where comment=$Comment type=A ];
- :if ([ :len $DnsRecord ] > 0) do={
- :local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
-
- :if ($DnsRecordVal->"address" = $LeaseVal->"active-address" && $DnsRecordVal->"name" = $FullA) do={
- $LogPrint debug $ScriptName ("The A record for " . $MacInServer . " (" . $FullA . ") does not need updating.");
- } else={
- $LogPrint info $ScriptName ("Updating A record for " . $MacInServer . " (" . $FullA . " -> " . $LeaseVal->"active-address" . ").");
- /ip/dns/static/set address=($LeaseVal->"active-address") name=$FullA $DnsRecord;
- }
-
- :local CName [ /ip/dns/static/find where comment=$Comment type=CNAME ];
- :if ([ :len $CName ] > 0) do={
- :local CNameVal [ /ip/dns/static/get $CName ];
- :if ($CNameVal->"name" != $FullCN || $CNameVal->"cname" != $FullA) do={
- $LogPrint info $ScriptName ("Deleting CNAME record with wrong data for " . $MacInServer . ".");
- /ip/dns/static/remove $CName;
- }
- }
- :if ([ :len $HostName ] > 0 && [ :len [ /ip/dns/static/find where name=$FullCN type=CNAME ] ] = 0) do={
- $LogPrint info $ScriptName ("Adding CNAME record for " . $MacInServer . " (" . $FullCN . " -> " . $FullA . ").");
- /ip/dns/static/add name=$FullCN type=CNAME cname=$FullA ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
- }
-
- } else={
- $LogPrint info $ScriptName ("Adding A record for " . $MacInServer . " (" . $FullA . " -> " . $LeaseVal->"active-address" . ").");
- /ip/dns/static/add name=$FullA type=A address=($LeaseVal->"active-address") ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
- :if ([ :len $HostName ] > 0 && [ :len [ /ip/dns/static/find where name=$FullCN type=CNAME ] ] = 0) do={
- $LogPrint info $ScriptName ("Adding CNAME record for " . $MacInServer . " (" . $FullCN . " -> " . $FullA . ").");
- /ip/dns/static/add name=$FullCN type=CNAME cname=$FullA ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
- }
- }
-
- :if ([ :len [ /ip/dns/static/find where name=$FullA type=A ] ] > 1) do={
- $LogPrintOnce warning $ScriptName ("The name '" . $FullA . "' appeared in more than one A record!");
- }
- } else={
+ :if ([ :len ($LeaseVal->"active-address") ] = 0) do={
$LogPrint debug $ScriptName ("No address available... Ignoring.");
+ :continue;
+ }
+
+ :local Network [ /ip/dhcp-server/network/find where ($LeaseVal->"active-address") in address ];
+ :local NetworkVal;
+ :if ([ :len $Network ] > 0) do={
+ :set NetworkVal [ /ip/dhcp-server/network/get ($Network->0) ];
+ }
+ :local NetworkInfo [ $ParseKeyValueStore ($NetworkVal->"comment") ];
+
+ :if ($NetworkInfo->"dns-ignore" = true) do={
+ $LogPrint debug $ScriptName ("Lease for " . $LeaseVal->"active-mac-address" . " is in ignored network... Skipping.");
+ :continue;
+ }
+
+ :local Comment ($CommentPrefix . ", macaddress=" . $LeaseVal->"active-mac-address" . ", server=" . $LeaseVal->"server");
+ :local MacDash [ $CleanName ($LeaseVal->"active-mac-address") ];
+ :local HostName [ $CleanName [ $EitherOr ([ $ParseKeyValueStore ($LeaseVal->"comment") ]->"hostname") ($LeaseVal->"host-name") ] ];
+ :local NetDomain ([ $IfThenElse ([ :len ($NetworkInfo->"name-extra") ] > 0) ($NetworkInfo->"name-extra" . ".") ] . \
+ [ $EitherOr [ $EitherOr ($NetworkInfo->"domain") ($NetworkVal->"domain") ] $Domain ]);
+ :local FullA ($MacDash . "." . $NetDomain);
+ :local FullCN ($HostName . "." . $NetDomain);
+ :local MacInServer ($LeaseVal->"active-mac-address" . " in " . $LeaseVal->"server");
+
+ :local DnsRecord [ /ip/dns/static/find where comment=$Comment type=A ];
+ :if ([ :len $DnsRecord ] > 0) do={
+ :local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
+
+ :if ($DnsRecordVal->"address" = $LeaseVal->"active-address" && $DnsRecordVal->"name" = $FullA) do={
+ $LogPrint debug $ScriptName ("The A record for " . $MacInServer . " (" . $FullA . ") does not need updating.");
+ } else={
+ $LogPrint info $ScriptName ("Updating A record for " . $MacInServer . " (" . $FullA . " -> " . $LeaseVal->"active-address" . ").");
+ /ip/dns/static/set address=($LeaseVal->"active-address") name=$FullA $DnsRecord;
+ }
+
+ :local CName [ /ip/dns/static/find where comment=$Comment type=CNAME ];
+ :if ([ :len $CName ] > 0) do={
+ :local CNameVal [ /ip/dns/static/get $CName ];
+ :if ($CNameVal->"name" != $FullCN || $CNameVal->"cname" != $FullA) do={
+ $LogPrint info $ScriptName ("Deleting CNAME record with wrong data for " . $MacInServer . ".");
+ /ip/dns/static/remove $CName;
+ }
+ }
+ :if ([ :len $HostName ] > 0 && [ :len [ /ip/dns/static/find where name=$FullCN type=CNAME ] ] = 0) do={
+ $LogPrint info $ScriptName ("Adding CNAME record for " . $MacInServer . " (" . $FullCN . " -> " . $FullA . ").");
+ /ip/dns/static/add name=$FullCN type=CNAME cname=$FullA ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
+ }
+
+ } else={
+ $LogPrint info $ScriptName ("Adding A record for " . $MacInServer . " (" . $FullA . " -> " . $LeaseVal->"active-address" . ").");
+ /ip/dns/static/add name=$FullA type=A address=($LeaseVal->"active-address") ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
+ :if ([ :len $HostName ] > 0 && [ :len [ /ip/dns/static/find where name=$FullCN type=CNAME ] ] = 0) do={
+ $LogPrint info $ScriptName ("Adding CNAME record for " . $MacInServer . " (" . $FullCN . " -> " . $FullA . ").");
+ /ip/dns/static/add name=$FullCN type=CNAME cname=$FullA ttl=$Ttl comment=$Comment place-before=$PlaceBefore;
+ }
+ }
+
+ :if ([ :len [ /ip/dns/static/find where name=$FullA type=A ] ] > 1) do={
+ $LogPrintOnce warning $ScriptName ("The name '" . $FullA . "' appeared in more than one A record!");
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/doc/accesslist-duplicates.md b/doc/accesslist-duplicates.md
index 9eca50d3..d6ad853c 100644
--- a/doc/accesslist-duplicates.md
+++ b/doc/accesslist-duplicates.md
@@ -4,7 +4,7 @@ Find and remove access list duplicates
[](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)
diff --git a/doc/backup-cloud.md b/doc/backup-cloud.md
index dcbd0f75..32e39386 100644
--- a/doc/backup-cloud.md
+++ b/doc/backup-cloud.md
@@ -4,7 +4,7 @@ Upload backup to Mikrotik cloud
[](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)
diff --git a/doc/backup-email.md b/doc/backup-email.md
index cf334697..a8dfe0b9 100644
--- a/doc/backup-email.md
+++ b/doc/backup-email.md
@@ -4,7 +4,7 @@ Send backup via e-mail
[](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)
diff --git a/doc/backup-partition.md b/doc/backup-partition.md
index 6588cbe3..d8c0a7d7 100644
--- a/doc/backup-partition.md
+++ b/doc/backup-partition.md
@@ -4,7 +4,7 @@ Save configuration to fallback partition
[](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)
diff --git a/doc/backup-upload.md b/doc/backup-upload.md
index 221cb721..c2e5c391 100644
--- a/doc/backup-upload.md
+++ b/doc/backup-upload.md
@@ -4,7 +4,7 @@ Upload backup to server
[](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)
diff --git a/doc/capsman-download-packages.md b/doc/capsman-download-packages.md
index c00b7235..4f113674 100644
--- a/doc/capsman-download-packages.md
+++ b/doc/capsman-download-packages.md
@@ -4,7 +4,7 @@ Download packages for CAP upgrade from CAPsMAN
[](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)
diff --git a/doc/capsman-rolling-upgrade.md b/doc/capsman-rolling-upgrade.md
index 85f86289..74977469 100644
--- a/doc/capsman-rolling-upgrade.md
+++ b/doc/capsman-rolling-upgrade.md
@@ -4,7 +4,7 @@ Run rolling CAP upgrades from CAPsMAN
[](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)
diff --git a/doc/certificate-renew-issued.md b/doc/certificate-renew-issued.md
index 2ed56ec5..89fc8077 100644
--- a/doc/certificate-renew-issued.md
+++ b/doc/certificate-renew-issued.md
@@ -4,7 +4,7 @@ Renew locally issued certificates
[](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)
diff --git a/doc/check-certificates.md b/doc/check-certificates.md
index c6db7c88..54d8e5c0 100644
--- a/doc/check-certificates.md
+++ b/doc/check-certificates.md
@@ -4,7 +4,7 @@ Renew certificates and notify on expiration
[](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)
diff --git a/doc/check-health.md b/doc/check-health.md
index d67a3dde..4b2d22f3 100644
--- a/doc/check-health.md
+++ b/doc/check-health.md
@@ -4,7 +4,7 @@ Notify about health state
[](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)
diff --git a/doc/check-lte-firmware-upgrade.md b/doc/check-lte-firmware-upgrade.md
index 37ca4896..e93a0c66 100644
--- a/doc/check-lte-firmware-upgrade.md
+++ b/doc/check-lte-firmware-upgrade.md
@@ -4,7 +4,7 @@ Notify on LTE firmware upgrade
[](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)
diff --git a/doc/check-perpetual-license.md b/doc/check-perpetual-license.md
index de91eeb5..30f00080 100644
--- a/doc/check-perpetual-license.md
+++ b/doc/check-perpetual-license.md
@@ -4,7 +4,7 @@ Check perpetual license on CHR
[](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)
diff --git a/doc/check-routeros-update.md b/doc/check-routeros-update.md
index 18ad444a..155fa612 100644
--- a/doc/check-routeros-update.md
+++ b/doc/check-routeros-update.md
@@ -4,7 +4,7 @@ Notify on RouterOS update
[](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)
diff --git a/doc/collect-wireless-mac.md b/doc/collect-wireless-mac.md
index 9fef2adb..9dc6d80b 100644
--- a/doc/collect-wireless-mac.md
+++ b/doc/collect-wireless-mac.md
@@ -4,7 +4,7 @@ Collect MAC addresses in wireless access list
[](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)
diff --git a/doc/daily-psk.md b/doc/daily-psk.md
index 7ddb4d98..ab56ce29 100644
--- a/doc/daily-psk.md
+++ b/doc/daily-psk.md
@@ -4,7 +4,7 @@ Use wireless network with daily psk
[](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)
diff --git a/doc/dhcp-lease-comment.md b/doc/dhcp-lease-comment.md
index 2bda80be..75333876 100644
--- a/doc/dhcp-lease-comment.md
+++ b/doc/dhcp-lease-comment.md
@@ -4,7 +4,7 @@ Comment DHCP leases with info from access list
[](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)
diff --git a/doc/dhcp-to-dns.md b/doc/dhcp-to-dns.md
index a7e7a680..7607200a 100644
--- a/doc/dhcp-to-dns.md
+++ b/doc/dhcp-to-dns.md
@@ -4,7 +4,7 @@ Create DNS records for DHCP leases
[](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)
@@ -50,8 +50,12 @@ A bound lease for mac address `00:11:22:33:44:55` with ip address
`10.0.0.50` would result in an A record `00-11-22-33-44-55.example.com`
pointing to the given ip address.
-Additional options can be given from comment, to add an extra level in
-dns name or define a different domain.
+Additional options can be given from comment, first of all you can opt-out
+for specific networks:
+
+ /ip/dhcp-server/network/add address=10.0.0.0/24 domain=example.com comment="dns-ignore=true";
+
+Use this to add an extra level in dns name or define a different domain.
/ip/dhcp-server/network/add address=10.0.0.0/24 domain=example.com comment="domain=another-domain.com, name-extra=dhcp";
diff --git a/doc/firmware-upgrade-reboot.md b/doc/firmware-upgrade-reboot.md
index 19fd94cb..c282cad5 100644
--- a/doc/firmware-upgrade-reboot.md
+++ b/doc/firmware-upgrade-reboot.md
@@ -4,7 +4,7 @@ Automatically upgrade firmware and reboot
[](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)
diff --git a/doc/fw-addr-lists.md b/doc/fw-addr-lists.md
index 5b29af7c..748cc973 100644
--- a/doc/fw-addr-lists.md
+++ b/doc/fw-addr-lists.md
@@ -4,7 +4,7 @@ Download, import and update firewall address-lists
[](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)
diff --git a/doc/global-wait.md b/doc/global-wait.md
index 49f53c6a..28ebfe96 100644
--- a/doc/global-wait.md
+++ b/doc/global-wait.md
@@ -4,7 +4,7 @@ Wait for global functions and modules
[](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)
diff --git a/doc/gps-track.md b/doc/gps-track.md
index dc80b9f7..ed71a522 100644
--- a/doc/gps-track.md
+++ b/doc/gps-track.md
@@ -4,7 +4,7 @@ Send GPS position to server
[](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)
diff --git a/doc/hotspot-to-wpa.md b/doc/hotspot-to-wpa.md
index 22d1dd13..5187671b 100644
--- a/doc/hotspot-to-wpa.md
+++ b/doc/hotspot-to-wpa.md
@@ -4,7 +4,7 @@ Use WPA network with hotspot credentials
[](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)
diff --git a/doc/ip-addr-bridge.md b/doc/ip-addr-bridge.md
index 1868bc70..af5e3ef7 100644
--- a/doc/ip-addr-bridge.md
+++ b/doc/ip-addr-bridge.md
@@ -4,7 +4,7 @@ Manage IP addresses with bridge status
[](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)
diff --git a/doc/ipsec-to-dns.md b/doc/ipsec-to-dns.md
index cf4abeeb..b043e02a 100644
--- a/doc/ipsec-to-dns.md
+++ b/doc/ipsec-to-dns.md
@@ -4,7 +4,7 @@ Create DNS records for IPSec peers
[](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)
diff --git a/doc/ipv6-update.md b/doc/ipv6-update.md
index 792f97e9..96d62594 100644
--- a/doc/ipv6-update.md
+++ b/doc/ipv6-update.md
@@ -4,7 +4,7 @@ Update configuration on IPv6 prefix change
[](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)
diff --git a/doc/lease-script.md b/doc/lease-script.md
index 6bcf7e13..f4241afa 100644
--- a/doc/lease-script.md
+++ b/doc/lease-script.md
@@ -4,7 +4,7 @@ Run other scripts on DHCP lease
[](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)
diff --git a/doc/leds-mode.md b/doc/leds-mode.md
index 84098d53..a4c4293e 100644
--- a/doc/leds-mode.md
+++ b/doc/leds-mode.md
@@ -4,7 +4,7 @@ Manage LEDs dark mode
[](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)
diff --git a/doc/log-forward.md b/doc/log-forward.md
index 7bee120f..a94e7fd0 100644
--- a/doc/log-forward.md
+++ b/doc/log-forward.md
@@ -4,7 +4,7 @@ Forward log messages via notification
[](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)
diff --git a/doc/mod/bridge-port-to.md b/doc/mod/bridge-port-to.md
index e0e75b20..40df12a9 100644
--- a/doc/mod/bridge-port-to.md
+++ b/doc/mod/bridge-port-to.md
@@ -4,7 +4,7 @@ Manage ports in bridge
[](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)
diff --git a/doc/mod/bridge-port-vlan.md b/doc/mod/bridge-port-vlan.md
index a8593fb2..691a66ad 100644
--- a/doc/mod/bridge-port-vlan.md
+++ b/doc/mod/bridge-port-vlan.md
@@ -4,7 +4,7 @@ Manage VLANs on bridge ports
[](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)
diff --git a/doc/mod/inspectvar.md b/doc/mod/inspectvar.md
index 28032651..b1c5a876 100644
--- a/doc/mod/inspectvar.md
+++ b/doc/mod/inspectvar.md
@@ -4,7 +4,7 @@ Inspect variables
[](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)
diff --git a/doc/mod/ipcalc.md b/doc/mod/ipcalc.md
index c393ec3a..de32f39e 100644
--- a/doc/mod/ipcalc.md
+++ b/doc/mod/ipcalc.md
@@ -4,7 +4,7 @@ IP address calculation
[](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)
diff --git a/doc/mod/notification-email.md b/doc/mod/notification-email.md
index c45e917c..90f19815 100644
--- a/doc/mod/notification-email.md
+++ b/doc/mod/notification-email.md
@@ -4,7 +4,7 @@ Send notifications via e-mail
[](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)
diff --git a/doc/mod/notification-gotify.md b/doc/mod/notification-gotify.md
index 7482ba72..6fb0d05e 100644
--- a/doc/mod/notification-gotify.md
+++ b/doc/mod/notification-gotify.md
@@ -4,7 +4,7 @@ Send notifications via Gotify
[](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)
diff --git a/doc/mod/notification-matrix.md b/doc/mod/notification-matrix.md
index 60001416..c3455afd 100644
--- a/doc/mod/notification-matrix.md
+++ b/doc/mod/notification-matrix.md
@@ -4,7 +4,7 @@ Send notifications via Matrix
[](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)
diff --git a/doc/mod/notification-ntfy.md b/doc/mod/notification-ntfy.md
index b3534017..aa61fdc9 100644
--- a/doc/mod/notification-ntfy.md
+++ b/doc/mod/notification-ntfy.md
@@ -4,7 +4,7 @@ Send notifications via Ntfy
[](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)
diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md
index 1d2cec8c..3ae1b2a8 100644
--- a/doc/mod/notification-telegram.md
+++ b/doc/mod/notification-telegram.md
@@ -4,7 +4,7 @@ Send notifications via Telegram
[](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)
diff --git a/doc/mod/scriptrunonce.md b/doc/mod/scriptrunonce.md
index e960d767..f7b638ba 100644
--- a/doc/mod/scriptrunonce.md
+++ b/doc/mod/scriptrunonce.md
@@ -4,7 +4,7 @@ Download script and run it once
[](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)
diff --git a/doc/mod/ssh-keys-import.md b/doc/mod/ssh-keys-import.md
index c2d3c951..9fb289ac 100644
--- a/doc/mod/ssh-keys-import.md
+++ b/doc/mod/ssh-keys-import.md
@@ -4,7 +4,7 @@ Import ssh keys for public key authentication
[](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)
@@ -38,9 +38,8 @@ import that key:
$SSHKeysImport "ssh-rsa AAAAB3Nza...QYZk8= user" admin;
The third part of the key (`user` in this example) is inherited as
-`info` in RouterOS (or `key-owner` with RouterOS 7.20.x and before). Also
-the `MD5` fingerprint is recorded, this helps to audit and verify the
-available keys.
+`info` in RouterOS. Also the `MD5` fingerprint is recorded, this helps
+to audit and verify the available keys.
> âšī¸ī¸ **Info**: Use `ssh-keygen` to show a fingerprint of an existing public
> key file: `ssh-keygen -l -E md5 -f ~/.ssh/id_ed25519.pub`
diff --git a/doc/mode-button.md b/doc/mode-button.md
index 46a66b0c..054f3ce8 100644
--- a/doc/mode-button.md
+++ b/doc/mode-button.md
@@ -4,7 +4,7 @@ Mode button with multiple presses
[](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)
diff --git a/doc/netwatch-dns.md b/doc/netwatch-dns.md
index c80b819b..1e2fbe9f 100644
--- a/doc/netwatch-dns.md
+++ b/doc/netwatch-dns.md
@@ -4,7 +4,7 @@ Manage DNS and DoH servers from netwatch
[](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)
diff --git a/doc/netwatch-notify.md b/doc/netwatch-notify.md
index 70d6fe03..1319d88a 100644
--- a/doc/netwatch-notify.md
+++ b/doc/netwatch-notify.md
@@ -4,7 +4,7 @@ Notify on host up and down
[](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)
diff --git a/doc/ospf-to-leds.md b/doc/ospf-to-leds.md
index aa660071..7ff1872c 100644
--- a/doc/ospf-to-leds.md
+++ b/doc/ospf-to-leds.md
@@ -4,7 +4,7 @@ Visualize OSPF state via LEDs
[](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)
diff --git a/doc/packages-update.md b/doc/packages-update.md
index 73354490..1f106949 100644
--- a/doc/packages-update.md
+++ b/doc/packages-update.md
@@ -4,7 +4,7 @@ Manage system update
[](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)
diff --git a/doc/ppp-on-up.md b/doc/ppp-on-up.md
index e92601a2..51c8bc96 100644
--- a/doc/ppp-on-up.md
+++ b/doc/ppp-on-up.md
@@ -4,7 +4,7 @@ Run scripts on ppp connection
[](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)
diff --git a/doc/sms-action.md b/doc/sms-action.md
index af44ae46..97b53703 100644
--- a/doc/sms-action.md
+++ b/doc/sms-action.md
@@ -4,7 +4,7 @@ Act on received SMS
[](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)
diff --git a/doc/sms-forward.md b/doc/sms-forward.md
index 5f038926..20094645 100644
--- a/doc/sms-forward.md
+++ b/doc/sms-forward.md
@@ -4,7 +4,7 @@ Forward received SMS
[](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)
diff --git a/doc/super-mario-theme.md b/doc/super-mario-theme.md
index badb1c56..bda47247 100644
--- a/doc/super-mario-theme.md
+++ b/doc/super-mario-theme.md
@@ -4,7 +4,7 @@ Play Super Mario theme
[](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)
diff --git a/doc/telegram-chat.md b/doc/telegram-chat.md
index 51cd3d6a..81f65d64 100644
--- a/doc/telegram-chat.md
+++ b/doc/telegram-chat.md
@@ -4,7 +4,7 @@ Chat with your router and send commands via Telegram bot
[](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)
diff --git a/doc/unattended-lte-firmware-upgrade.md b/doc/unattended-lte-firmware-upgrade.md
index 3e4e2d4b..050e67c0 100644
--- a/doc/unattended-lte-firmware-upgrade.md
+++ b/doc/unattended-lte-firmware-upgrade.md
@@ -4,7 +4,7 @@ Install LTE firmware upgrade
[](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)
diff --git a/doc/update-gre-address.md b/doc/update-gre-address.md
index 64c61f21..63bc4fa2 100644
--- a/doc/update-gre-address.md
+++ b/doc/update-gre-address.md
@@ -4,7 +4,7 @@ Update GRE configuration with dynamic addresses
[](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)
diff --git a/doc/update-tunnelbroker.md b/doc/update-tunnelbroker.md
index 342b1a1b..7f91fa11 100644
--- a/doc/update-tunnelbroker.md
+++ b/doc/update-tunnelbroker.md
@@ -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)
diff --git a/firmware-upgrade-reboot.rsc b/firmware-upgrade-reboot.rsc
index 7c64909d..410006cf 100644
--- a/firmware-upgrade-reboot.rsc
+++ b/firmware-upgrade-reboot.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2022-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# install firmware upgrade, and reboot
# https://rsc.eworm.de/doc/firmware-upgrade-reboot.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -20,21 +19,18 @@
:global VersionToNum;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local RouterBoard [ /system/routerboard/get ];
:if ($RouterBoard->"current-firmware" = $RouterBoard->"upgrade-firmware") do={
$LogPrint info $ScriptName ("Current and upgrade firmware match with version " . \
$RouterBoard->"current-firmware" . ".");
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ $VersionToNum ($RouterBoard->"current-firmware") ] > [ $VersionToNum ($RouterBoard->"upgrade-firmware") ]) do={
$LogPrint info $ScriptName ("Different firmware version is available, but it is a downgrade. Ignoring.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:if ([ /system/routerboard/settings/get auto-upgrade ] = false) do={
@@ -56,5 +52,5 @@
$LogPrint info $ScriptName ("Firmware upgrade successful, rebooting.");
/system/reboot;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/fw-addr-lists.rsc b/fw-addr-lists.rsc
index ac15c652..55276138 100644
--- a/fw-addr-lists.rsc
+++ b/fw-addr-lists.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2023-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# download, import and update firewall address-lists
# https://rsc.eworm.de/doc/fw-addr-lists.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -46,8 +45,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -113,41 +111,40 @@
} else={
:set Address ([ :pick $Line 0 [ $FindDelim $Line ] ] . ($List->"cidr"));
}
- :do {
- :local Branch;
- :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={
- :local Net $Address;
- :local CIDR 32;
- :local Slash [ :find $Address "/" ];
- :if ([ :typeof $Slash ] = "num") do={
- :set Net [ :toip [ :pick $Address 0 $Slash ] ]
- :set CIDR [ :pick $Address ($Slash + 1) [ :len $Address ] ];
- :set Address [ :tostr (([ :toip $Net ] & [ $NetMask4 $CIDR ]) . [ $IfThenElse ($CIDR < 32) ("/" . $CIDR) ]) ];
- }
- :set Branch [ $GetBranch $Address ];
- :set ($IPv4Addresses->$Branch->$Address) $TimeOut;
- :error true;
+
+ :local Branch;
+ :if ($Address ~ "^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}(/[0-9]{1,2})?\$") do={
+ :local Net $Address;
+ :local CIDR 32;
+ :local Slash [ :find $Address "/" ];
+ :if ([ :typeof $Slash ] = "num") do={
+ :set Net [ :toip [ :pick $Address 0 $Slash ] ]
+ :set CIDR [ :pick $Address ($Slash + 1) [ :len $Address ] ];
+ :set Address [ :tostr (([ :toip $Net ] & [ $NetMask4 $CIDR ]) . [ $IfThenElse ($CIDR < 32) ("/" . $CIDR) ]) ];
}
- :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={
- :local Net $Address;
- :local CIDR 128;
- :local Slash [ :find $Address "/" ];
- :if ([ :typeof $Slash ] = "num") do={
- :set Net [ :toip6 [ :pick $Address 0 $Slash ] ]
- :set CIDR [ :pick $Address ($Slash + 1) [ :len $Address ] ];
- }
- :set Address (([ :toip6 $Net ] & [ $NetMask6 $CIDR ]) . "/" . $CIDR);
- :set Branch [ $GetBranch $Address ];
- :set ($IPv6Addresses->$Branch->$Address) $TimeOut;
- :error true;
+ :set Branch [ $GetBranch $Address ];
+ :set ($IPv4Addresses->$Branch->$Address) $TimeOut;
+ :continue;
+ }
+ :if ($Address ~ "^[0-9a-zA-Z]*:[0-9a-zA-Z:\\.]+(/[0-9]{1,3})?\$") do={
+ :local Net $Address;
+ :local CIDR 128;
+ :local Slash [ :find $Address "/" ];
+ :if ([ :typeof $Slash ] = "num") do={
+ :set Net [ :toip6 [ :pick $Address 0 $Slash ] ]
+ :set CIDR [ :pick $Address ($Slash + 1) [ :len $Address ] ];
}
- :if ($Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={
- :set Branch [ $GetBranch $Address ];
- :set ($IPv4Addresses->$Branch->$Address) $TimeOut;
- :set ($IPv6Addresses->$Branch->$Address) $TimeOut;
- :error true;
- }
- } on-error={ }
+ :set Address (([ :toip6 $Net ] & [ $NetMask6 $CIDR ]) . "/" . $CIDR);
+ :set Branch [ $GetBranch $Address ];
+ :set ($IPv6Addresses->$Branch->$Address) $TimeOut;
+ :continue;
+ }
+ :if ($Address ~ "^[\\.a-zA-Z0-9-]+\\.[a-zA-Z]{2,}\$") do={
+ :set Branch [ $GetBranch $Address ];
+ :set ($IPv4Addresses->$Branch->$Address) $TimeOut;
+ :set ($IPv6Addresses->$Branch->$Address) $TimeOut;
+ :continue;
+ }
}
}
@@ -232,5 +229,5 @@
" - removed: " . [ $HumanReadableNum $CntRemove 1000 ]);
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/global-functions.d/deprecated.rsc b/global-functions.d/deprecated.rsc
index fe492098..b35f78c6 100644
--- a/global-functions.d/deprecated.rsc
+++ b/global-functions.d/deprecated.rsc
@@ -3,7 +3,36 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.17
+# requires RouterOS, version=7.22
#
# deprecated global functions
# https://rsc.eworm.de/
+
+:global ExitError;
+:global HexToNum;
+
+# wrapper for $ExitOnError with additional parameter
+:set ExitError do={
+ :local ExitOK [ :tostr $1 ];
+ :local Name [ :tostr $2 ];
+ :local Error [ :tostr $3 ];
+
+ :global ExitOnError;
+
+ :if ($ExitOK = "false") do={
+ $ExitOnError $Name $Error;
+ }
+}
+
+# convert from hex (string) to num
+:set HexToNum do={
+ :local Input [ :tostr $1 ];
+
+ :global HexToNum;
+
+ :if ([ :pick $Input 0 ] = "*") do={
+ :return [ $HexToNum [ :pick $Input 1 [ :len $Input ] ] ];
+ }
+
+ :return [ :tonum ("0x" . $Input) ];
+}
diff --git a/global-functions.rsc b/global-functions.rsc
index cb74f991..33d00562 100644
--- a/global-functions.rsc
+++ b/global-functions.rsc
@@ -4,7 +4,7 @@
# Michael Gisbers
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# global functions
@@ -36,7 +36,6 @@
:global DownloadPackage;
:global EitherOr;
:global EscapeForRegEx;
-:global ExitError;
:global ExitOnError;
:global FetchHuge;
:global FetchUserAgentStr;
@@ -49,7 +48,6 @@
:global GetRandom20CharHex;
:global GetRandomNumber;
:global Grep;
-:global HexToNum;
:global HumanReadableNum;
:global IfThenElse;
:global IsDefaultRouteReachable;
@@ -130,8 +128,7 @@
}
:local CertSettings [ /certificate/settings/get ];
- :if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
- ($CertSettings->"builtin-trust-store") ~ $UseFor || \
+ :if ((($CertSettings->"builtin-trust-store") ~ $UseFor || \
($CertSettings->"builtin-trust-store") = "all") && \
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
:return true;
@@ -485,19 +482,6 @@
:return $Return;
}
-# wrapper for $ExitOnError with additional parameter
-:set ExitError do={
- :local ExitOK [ :tostr $1 ];
- :local Name [ :tostr $2 ];
- :local Error [ :tostr $3 ];
-
- :global ExitOnError;
-
- :if ($ExitOK = "false") do={
- $ExitOnError $Name $Error;
- }
-}
-
# simple macro to print error message on unintentional error
:set ExitOnError do={
:local Name [ :tostr $1 ];
@@ -739,19 +723,6 @@
:return [];
}
-# convert from hex (string) to num
-:set HexToNum do={
- :local Input [ :tostr $1 ];
-
- :global HexToNum;
-
- :if ([ :pick $Input 0 ] = "*") do={
- :return [ $HexToNum [ :pick $Input 1 [ :len $Input ] ] ];
- }
-
- :return [ :tonum ("0x" . $Input) ];
-}
-
# return human readable number
:set HumanReadableNum do={
:local Input [ :tonum $1 ];
@@ -1046,31 +1017,9 @@
# return an IPv6 netmask for CIDR
:set NetMask6 do={
- :local CIDR [ :tostr $1 ];
+ :local CIDR [ :tonum $1 ];
- :global IfThenElse;
- :global MAX;
- :global MIN;
-
- :global NetMask6Cache;
-
- :if ([ :typeof ($NetMask6Cache->$CIDR) ] = "ip6") do={
- :return ($NetMask6Cache->$CIDR);
- }
-
- :if ([ :typeof $NetMask6Cache ] = "nothing") do={
- :set NetMask6Cache ({});
- }
-
- :local Mask "";
- :for I from=0 to=7 do={
- :set Mask ($Mask . \
- [ :convert from=num to=hex (0xffff - (0xffff >> [ :tonum [ $MIN [ $MAX ($CIDR - (16 * $I)) 0 ] 16 ] ])) ] . \
- [ $IfThenElse ($I < 7) ":" ]);
- }
- :set Mask [ :toip6 $Mask ];
- :set ($NetMask6Cache->$CIDR) $Mask;
- :return $Mask;
+ :return (((~::) << (128 - $CIDR)) & (~::));
}
# prepare NotificationFunctions array
@@ -1324,105 +1273,103 @@
}
}
- :do {
- :if ($ScriptInfo->"ignore" = true) do={
- $LogPrint debug $0 ("Ignoring script '" . $ScriptVal->"name" . "', as requested.");
- :error true;
+ :if ($ScriptInfo->"ignore" = true) do={
+ $LogPrint debug $0 ("Ignoring script '" . $ScriptVal->"name" . "', as requested.");
+ :continue;
+ }
+
+ :local CheckSum ($CheckSums->($ScriptVal->"name"));
+ :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \
+ [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={
+ $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring.");
+ :continue;
+ }
+
+ :if ([ :len ($ScriptInfo->"certificate") ] > 0) do={
+ :if ([ $CertificateAvailable ($ScriptInfo->"certificate") "fetch" ] = false) do={
+ $LogPrint warning $0 ("Downloading certificate failed, trying without.");
+ }
+ }
+
+ :onerror Err {
+ :local BaseUrl [ $EitherOr ($ScriptInfo->"base-url") $ScriptUpdatesBaseUrl ];
+ :local UrlSuffix [ $EitherOr ($ScriptInfo->"url-suffix") $ScriptUpdatesUrlSuffix ];
+ :local Url ($BaseUrl . $ScriptVal->"name" . ".rsc" . $UrlSuffix);
+ $LogPrint debug $0 ("Fetching script '" . $ScriptVal->"name" . "' from url: " . $Url);
+ :local Result [ /tool/fetch check-certificate=yes-without-crl \
+ http-header-field=({ [ $FetchUserAgentStr $0 ] }) $Url output=user as-value ];
+ :if ($Result->"status" = "finished") do={
+ :set SourceNew [ :tolf ($Result->"data") ];
+ }
+ } do={
+ $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "': " . $Err);
+ :if ($Err != "Fetch failed with status 404") do={
+ :continue;
}
- :local CheckSum ($CheckSums->($ScriptVal->"name"));
+ :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={
+ $LogPrint warning $0 ("Removing dummy. Typo on installation?");
+ /system/script/remove $Script;
+ :continue;
+ }
:if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \
- [ :convert transform=md5 to=hex [ :tolf ($ScriptVal->"source") ] ] = $CheckSum) do={
- $LogPrint debug $0 ("Checksum for script '" . $ScriptVal->"name" . "' matches, ignoring.");
- :error true;
+ [ :len $CheckSum ] = 0) do={
+ $LogPrintOnce warning $0 \
+ ("Added the script manually? Skip updates with 'ignore=true' in comment.");
}
+ :continue;
+ }
- :if ([ :len ($ScriptInfo->"certificate") ] > 0) do={
- :if ([ $CertificateAvailable ($ScriptInfo->"certificate") "fetch" ] = false) do={
- $LogPrint warning $0 ("Downloading certificate failed, trying without.");
- }
- }
+ :if ([ :len $SourceNew ] = 0) do={
+ $LogPrint debug $0 ("No update for script '" . $ScriptVal->"name" . "'.");
+ :continue;
+ }
- :onerror Err {
- :local BaseUrl [ $EitherOr ($ScriptInfo->"base-url") $ScriptUpdatesBaseUrl ];
- :local UrlSuffix [ $EitherOr ($ScriptInfo->"url-suffix") $ScriptUpdatesUrlSuffix ];
- :local Url ($BaseUrl . $ScriptVal->"name" . ".rsc" . $UrlSuffix);
- $LogPrint debug $0 ("Fetching script '" . $ScriptVal->"name" . "' from url: " . $Url);
- :local Result [ /tool/fetch check-certificate=yes-without-crl \
- http-header-field=({ [ $FetchUserAgentStr $0 ] }) $Url output=user as-value ];
- :if ($Result->"status" = "finished") do={
- :set SourceNew [ :tolf ($Result->"data") ];
- }
- } do={
- $LogPrint warning $0 ("Failed fetching script '" . $ScriptVal->"name" . "': " . $Err);
- :if ($Err != "Fetch failed with status 404") do={
- :error false;
- }
+ :local SourceCRLF [ :tocrlf $SourceNew ];
+ :if ($SourceNew = $ScriptVal->"source" || $SourceCRLF = $ScriptVal->"source") do={
+ $LogPrint debug $0 ("Script '" . $ScriptVal->"name" . "' did not change.");
+ :continue;
+ }
- :if ($ScriptVal->"source" = "#!rsc by RouterOS\n") do={
- $LogPrint warning $0 ("Removing dummy. Typo on installation?");
- /system/script/remove $Script;
- :error false;
- }
- :if ([ :len ($ScriptInfo->"base-url") ] = 0 && [ :len ($ScriptInfo->"url-suffix") ] = 0 && \
- [ :len $CheckSum ] = 0) do={
- $LogPrintOnce warning $0 \
- ("Added the script manually? Skip updates with 'ignore=true' in comment.");
- }
- :error false;
- }
+ :if ([ :pick $SourceNew 0 18 ] != "#!rsc by RouterOS\n") do={
+ $LogPrint warning $0 ("Looks like new script '" . $ScriptVal->"name" . \
+ "' is not valid (missing shebang). Ignoring!");
+ :continue;
+ }
- :if ([ :len $SourceNew ] = 0) do={
- $LogPrint debug $0 ("No update for script '" . $ScriptVal->"name" . "'.");
- :error false;
- }
+ :local RequiredROS ([ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires RouterOS, ") ] ]->"version");
+ :if ([ $RequiredRouterOS $0 [ $EitherOr $RequiredROS "0.0" ] false ] = false) do={
+ $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \
+ $RequiredROS . ", which is not met by your installation. Ignoring!");
+ :continue;
+ }
- :local SourceCRLF [ :tocrlf $SourceNew ];
- :if ($SourceNew = $ScriptVal->"source" || $SourceCRLF = $ScriptVal->"source") do={
- $LogPrint debug $0 ("Script '" . $ScriptVal->"name" . "' did not change.");
- :error false;
+ :local RequiredDM [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires device-mode, ") ] ];
+ :local MissingDM ({});
+ :foreach Feature,Value in=$RequiredDM do={
+ :if ([ :typeof ($DeviceMode->$Feature) ] = "bool" && ($DeviceMode->$Feature) = false) do={
+ :set MissingDM ($MissingDM, $Feature);
}
+ }
+ :if ([ :len $MissingDM ] > 0) do={
+ $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires disabled " . \
+ "device-mode features (" . [ :tostr $MissingDM ] . "). Ignoring!");
+ :continue;
+ }
- :if ([ :pick $SourceNew 0 18 ] != "#!rsc by RouterOS\n") do={
- $LogPrint warning $0 ("Looks like new script '" . $ScriptVal->"name" . \
- "' is not valid (missing shebang). Ignoring!");
- :error false;
- }
+ :if ([ $ValidateSyntax $SourceNew ] = false) do={
+ $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . "' failed! Ignoring!");
+ :continue;
+ }
- :local RequiredROS ([ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires RouterOS, ") ] ]->"version");
- :if ([ $RequiredRouterOS $0 [ $EitherOr $RequiredROS "0.0" ] false ] = false) do={
- $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires RouterOS " . \
- $RequiredROS . ", which is not met by your installation. Ignoring!");
- :error false;
- }
-
- :local RequiredDM [ $ParseKeyValueStore [ $Grep $SourceNew ("\23 requires device-mode, ") ] ];
- :local MissingDM ({});
- :foreach Feature,Value in=$RequiredDM do={
- :if ([ :typeof ($DeviceMode->$Feature) ] = "bool" && ($DeviceMode->$Feature) = false) do={
- :set MissingDM ($MissingDM, $Feature);
- }
- }
- :if ([ :len $MissingDM ] > 0) do={
- $LogPrintOnce warning $0 ("The script '" . $ScriptVal->"name" . "' requires disabled " . \
- "device-mode features (" . [ :tostr $MissingDM ] . "). Ignoring!");
- :error false;
- }
-
- :if ([ $ValidateSyntax $SourceNew ] = false) do={
- $LogPrint warning $0 ("Syntax validation for script '" . $ScriptVal->"name" . "' failed! Ignoring!");
- :error false;
- }
-
- $LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
- /system/script/set owner=($ScriptVal->"name") \
- source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
- :if ($ScriptVal->"name" = "global-config" || \
- $ScriptVal->"name" = "global-functions" || \
- $ScriptVal->"name" ~ ("^(global-functions\\.d|mod)/.")) do={
- :set ReloadGlobal true;
- }
- } on-error={ }
+ $LogPrint info $0 ("Updating script: " . $ScriptVal->"name");
+ /system/script/set owner=($ScriptVal->"name") \
+ source=[ $IfThenElse ($ScriptUpdatesCRLF = true) $SourceCRLF $SourceNew ] $Script;
+ :if ($ScriptVal->"name" = "global-config" || \
+ $ScriptVal->"name" = "global-functions" || \
+ $ScriptVal->"name" ~ ("^(global-functions\\.d|mod)/.")) do={
+ :set ReloadGlobal true;
+ }
}
:if ($ReloadGlobal = true) do={
diff --git a/global-wait.rsc b/global-wait.rsc
index a3b9fad9..9df3e62e 100644
--- a/global-wait.rsc
+++ b/global-wait.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# wait for global-functions to finish
# https://rsc.eworm.de/doc/global-wait.md
diff --git a/gps-track.rsc b/gps-track.rsc
index ce55c049..b5fd5a45 100644
--- a/gps-track.rsc
+++ b/gps-track.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch
#
# track gps data by sending json data to http server
# https://rsc.eworm.de/doc/gps-track.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -25,8 +24,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -49,5 +47,5 @@
$LogPrint debug $ScriptName ("GPS data not valid.");
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa-cleanup.capsman.rsc b/hotspot-to-wpa-cleanup.capsman.rsc
index 35275313..10b762fb 100644
--- a/hotspot-to-wpa-cleanup.capsman.rsc
+++ b/hotspot-to-wpa-cleanup.capsman.rsc
@@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=80
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# manage and clean up private WPA passphrase after hotspot login
@@ -12,7 +12,6 @@
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -25,8 +24,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local DHCPServers ({});
@@ -76,5 +74,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa-cleanup.template.rsc b/hotspot-to-wpa-cleanup.template.rsc
index 398f194f..749f47e6 100644
--- a/hotspot-to-wpa-cleanup.template.rsc
+++ b/hotspot-to-wpa-cleanup.template.rsc
@@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=80
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# manage and clean up private WPA passphrase after hotspot login
@@ -13,7 +13,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -26,8 +25,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local DHCPServers ({});
@@ -83,5 +81,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa-cleanup.wifi.rsc b/hotspot-to-wpa-cleanup.wifi.rsc
index 17b9e545..eec7253b 100644
--- a/hotspot-to-wpa-cleanup.wifi.rsc
+++ b/hotspot-to-wpa-cleanup.wifi.rsc
@@ -4,7 +4,7 @@
# https://rsc.eworm.de/COPYING.md
#
# provides: lease-script, order=80
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# manage and clean up private WPA passphrase after hotspot login
@@ -12,7 +12,6 @@
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -25,8 +24,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local DHCPServers ({});
@@ -76,5 +74,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa.capsman.rsc b/hotspot-to-wpa.capsman.rsc
index 60945a1a..8d8afffc 100644
--- a/hotspot-to-wpa.capsman.rsc
+++ b/hotspot-to-wpa.capsman.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# add private WPA passphrase after hotspot login
@@ -11,7 +11,6 @@
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -27,14 +26,12 @@
:local UserName $username;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from hotspot on login.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Date [ /system/clock/get date ];
@@ -61,8 +58,7 @@
:if ($Template->"action" = "reject") do={
$LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'.");
- :set ExitOK true;
- :error true;
+ :exit;
}
# allow login page to load
@@ -101,5 +97,5 @@
:delay 2s;
/caps-man/access-list/set $Entry action=accept;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa.template.rsc b/hotspot-to-wpa.template.rsc
index 7c56cc10..eca5202e 100644
--- a/hotspot-to-wpa.template.rsc
+++ b/hotspot-to-wpa.template.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# add private WPA passphrase after hotspot login
@@ -12,7 +12,6 @@
# !! This is just a template to generate the real script!
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -28,14 +27,12 @@
:local UserName $username;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from hotspot on login.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Date [ /system/clock/get date ];
@@ -68,8 +65,7 @@
:if ($Template->"action" = "reject") do={
$LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'.");
- :set ExitOK true;
- :error true;
+ :exit;
}
# allow login page to load
@@ -121,5 +117,5 @@
/caps-man/access-list/set $Entry action=accept;
/interface/wifi/access-list/set $Entry action=accept;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/hotspot-to-wpa.wifi.rsc b/hotspot-to-wpa.wifi.rsc
index 68ed4c2e..432a9b6d 100644
--- a/hotspot-to-wpa.wifi.rsc
+++ b/hotspot-to-wpa.wifi.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, hotspot
#
# add private WPA passphrase after hotspot login
@@ -11,7 +11,6 @@
#
# !! Do not edit this file, it is generated from template!
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -27,14 +26,12 @@
:local UserName $username;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $MacAddress ] = "nothing" || [ :typeof $UserName ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from hotspot on login.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Date [ /system/clock/get date ];
@@ -61,8 +58,7 @@
:if ($Template->"action" = "reject") do={
$LogPrint info $ScriptName ("Ignoring login for hotspot '" . $Hotspot . "'.");
- :set ExitOK true;
- :error true;
+ :exit;
}
# allow login page to load
@@ -98,5 +94,5 @@
:delay 2s;
/interface/wifi/access-list/set $Entry action=accept;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/ipsec-to-dns.rsc b/ipsec-to-dns.rsc
index a08405fb..ad7f87c1 100644
--- a/ipsec-to-dns.rsc
+++ b/ipsec-to-dns.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2021-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, ipsec
#
# and add/remove/update DNS entries from IPSec mode-config
# https://rsc.eworm.de/doc/ipsec-to-dns.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -28,8 +27,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Zone \
@@ -80,5 +78,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/ipv6-update.rsc b/ipv6-update.rsc
index c87410cc..7b4e1c3f 100644
--- a/ipv6-update.rsc
+++ b/ipv6-update.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# update firewall and dns settings on IPv6 prefix change
# https://rsc.eworm.de/doc/ipv6-update.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -25,26 +24,22 @@
:local PdValid $"pd-valid";
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $NaAddress ] = "str") do={
$LogPrint info $ScriptName ("An address (" . $NaAddress . ") was acquired, not a prefix. Ignoring.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :typeof $PdPrefix ] = "nothing" || [ :typeof $PdValid ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from ipv6 dhcp-client.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ($PdValid != 1) do={
$LogPrint info $ScriptName ("The prefix " . $PdPrefix . " is no longer valid. Ignoring.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ];
@@ -103,5 +98,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/lease-script.rsc b/lease-script.rsc
index 991e6fac..a30dcc2d 100644
--- a/lease-script.rsc
+++ b/lease-script.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# run scripts on DHCP lease
# https://rsc.eworm.de/doc/lease-script.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -26,22 +25,19 @@
[ :typeof $leaseServerName ] = "nothing" || \
[ :typeof $leaseBound ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from ip dhcp-server.");
- :set ExitOK true;
- :error false;
+ :exit;
}
$LogPrint debug $ScriptName ("DHCP Server " . $leaseServerName . " " . [ $IfThenElse ($leaseBound = 0) \
"de" "" ] . "assigned lease " . $leaseActIP . " to " . $leaseActMAC);
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/script/job/find where script=$ScriptName ] ] > 1) do={
$LogPrint debug $ScriptName ("More invocations are waiting, exiting early.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:local RunOrder ({});
@@ -61,5 +57,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/log-forward.rsc b/log-forward.rsc
index 4d3ac813..f699cb56 100644
--- a/log-forward.rsc
+++ b/log-forward.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# forward log messages via notification
# https://rsc.eworm.de/doc/log-forward.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -24,7 +23,6 @@
:global LogForwardRateLimit;
:global EitherOr;
- :global HexToNum;
:global IfThenElse;
:global LogForwardFilterLogForwarding;
:global LogPrint;
@@ -34,8 +32,11 @@
:global SymbolForNotification;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
+ }
+
+ :if ([ :typeof $LogForwardLast ] = "nothing") do={
+ :set LogForwardLast false;
}
:if ([ :typeof $LogForwardRateLimit ] = "nothing") do={
@@ -45,13 +46,11 @@
:if ($LogForwardRateLimit > 30) do={
:set LogForwardRateLimit ($LogForwardRateLimit - 1);
$LogPrint info $ScriptName ("Rate limit in action, not forwarding logs, if any!");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Count 0;
:local Duplicates false;
- :local Last [ $IfThenElse ([ :len $LogForwardLast ] > 0) [ $HexToNum $LogForwardLast ] -1 ];
:local Messages "";
:local Warning false;
:local MessageVal;
@@ -63,37 +62,33 @@
:set LogForwardIncludeMessage [ $EitherOr $LogForwardIncludeMessage [] ];
:local LogAll [ /log/find ];
- :local MaxId ($LogAll->([ :len $LogAll ] - 1));
- :local MaxNum [ $HexToNum $MaxId ];
+ :local Max ($LogAll->([ :len $LogAll ] - 1));
:local LogForwardFilterLogForwardingCached [ $EitherOr [ $LogForwardFilterLogForwarding ] ("\$^") ];
- :foreach Message in=[ /log/find where (!(message="") and \
- !(message~$LogForwardFilterLogForwardingCached) and \
- !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
- topics~$LogForwardInclude or message~$LogForwardIncludeMessage ] do={
+ :foreach Message in=[ /log/find where .id>$LogForwardLast and .id<=$Max and \
+ ((!(message="") and !(message~$LogForwardFilterLogForwardingCached) and \
+ !(topics~$LogForwardFilter) and !(message~$LogForwardFilterMessage)) or \
+ topics~$LogForwardInclude or message~$LogForwardIncludeMessage) ] do={
:set MessageVal [ /log/get $Message ];
:local Bullet "information";
- :local Current [ $HexToNum ($MessageVal->".id") ];
- :if ($Last < $Current && $Current <= $MaxNum) do={
- :local DupCount ($MessageDups->($MessageVal->"message"));
- :if ($MessageVal->"topics" ~ "(warning)") do={
- :set Warning true;
- :set Bullet "large-orange-circle";
- }
- :if ($MessageVal->"topics" ~ "(emergency|alert|critical|error)") do={
- :set Warning true;
- :set Bullet "large-red-circle";
- }
- :if ($DupCount < 3) do={
- :set Messages ($Messages . "\n" . [ $SymbolForNotification $Bullet ] . \
- $MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message");
- } else={
- :set Duplicates true;
- }
- :set ($MessageDups->($MessageVal->"message")) ($DupCount + 1);
- :set Count ($Count + 1);
+ :local DupCount ($MessageDups->($MessageVal->"message"));
+ :if ($MessageVal->"topics" ~ "(warning)") do={
+ :set Warning true;
+ :set Bullet "large-orange-circle";
}
+ :if ($MessageVal->"topics" ~ "(emergency|alert|critical|error)") do={
+ :set Warning true;
+ :set Bullet "large-red-circle";
+ }
+ :if ($DupCount < 3) do={
+ :set Messages ($Messages . "\n" . [ $SymbolForNotification $Bullet ] . \
+ $MessageVal->"time" . " " . [ :tostr ($MessageVal->"topics") ] . " " . $MessageVal->"message");
+ } else={
+ :set Duplicates true;
+ }
+ :set ($MessageDups->($MessageVal->"message")) ($DupCount + 1);
+ :set Count ($Count + 1);
}
:if ($Count > 0) do={
@@ -111,7 +106,7 @@
:set LogForwardRateLimit [ $MAX 0 ($LogForwardRateLimit - 1) ];
}
- :set LogForwardLast $MaxId;
+ :set LogForwardLast $Max;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/mod/bridge-port-to.rsc b/mod/bridge-port-to.rsc
index d6516ef9..b1e77c98 100644
--- a/mod/bridge-port-to.rsc
+++ b/mod/bridge-port-to.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# reset bridge ports to default bridge
# https://rsc.eworm.de/doc/mod/bridge-port-to.md
diff --git a/mod/bridge-port-vlan.rsc b/mod/bridge-port-vlan.rsc
index 2f9b40b9..ca1def4a 100644
--- a/mod/bridge-port-vlan.rsc
+++ b/mod/bridge-port-vlan.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# manage VLANs on bridge ports
# https://rsc.eworm.de/doc/mod/bridge-port-vlan.md
diff --git a/mod/inspectvar.rsc b/mod/inspectvar.rsc
index f4b59fbd..e4f496c5 100644
--- a/mod/inspectvar.rsc
+++ b/mod/inspectvar.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# inspect variables
# https://rsc.eworm.de/doc/mod/inspectvar.md
diff --git a/mod/ipcalc.rsc b/mod/ipcalc.rsc
index 8db9dade..7f958ab4 100644
--- a/mod/ipcalc.rsc
+++ b/mod/ipcalc.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# ip address calculation
# https://rsc.eworm.de/doc/mod/ipcalc.md
diff --git a/mod/notification-email.rsc b/mod/notification-email.rsc
index b0ac77ac..0955194d 100644
--- a/mod/notification-email.rsc
+++ b/mod/notification-email.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, email, scheduler
#
# send notifications via e-mail
@@ -95,7 +95,6 @@
:foreach Id,Message in=$EmailQueue do={
:if ([ :typeof $Message ] = "array" ) do={
- :while ([ /tool/e-mail/get last-status ] = "in-progress") do={ :delay 1s; }
:onerror Err {
:local Attach ({});
:foreach File in=[ :toarray [ $EitherOr ($Message->"attach") "" ] ] do={
@@ -105,29 +104,15 @@
$LogPrint warning $0 ("File '" . $File . "' does not exist, can not attach.");
}
}
- :do {
- /tool/e-mail/send from=[ $EMailGenerateFrom ] to=($Message->"to") \
- cc=($Message->"cc") subject=($Message->"subject") \
- body=($Message->"body") file=$Attach;
- } on-error={ }
- :local Wait true;
- :do {
- :delay 1s;
- :local Status [ /tool/e-mail/get last-status ];
- :if ($Status = "succeeded") do={
- :set ($EmailQueue->$Id);
- :set Wait false;
- :if (($Message->"remove-attach") = true) do={
- :foreach File in=$Attach do={
- $RmFile $File;
- }
- }
+ /tool/e-mail/send from=[ $EMailGenerateFrom ] to=($Message->"to") \
+ cc=($Message->"cc") subject=($Message->"subject") \
+ body=($Message->"body") file=$Attach;
+ :set ($EmailQueue->$Id);
+ :if (($Message->"remove-attach") = true) do={
+ :foreach File in=$Attach do={
+ $RmFile $File;
}
- :if ($Status = "failed") do={
- :set AllDone false;
- :set Wait false;
- }
- } while=($Wait = true);
+ }
} do={
$LogPrint warning $0 ("Sending queued mail failed: " . $Err);
:set AllDone false;
diff --git a/mod/notification-gotify.rsc b/mod/notification-gotify.rsc
index 56face59..ff4bac3b 100644
--- a/mod/notification-gotify.rsc
+++ b/mod/notification-gotify.rsc
@@ -4,7 +4,7 @@
# Leonardo David Monteiro
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# send notifications via Gotify (gotify.net)
diff --git a/mod/notification-matrix.rsc b/mod/notification-matrix.rsc
index c737fa34..50da4f64 100644
--- a/mod/notification-matrix.rsc
+++ b/mod/notification-matrix.rsc
@@ -4,7 +4,7 @@
# Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# send notifications via Matrix
diff --git a/mod/notification-ntfy.rsc b/mod/notification-ntfy.rsc
index 6637517f..6dc41ff7 100644
--- a/mod/notification-ntfy.rsc
+++ b/mod/notification-ntfy.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# send notifications via Ntfy (ntfy.sh)
diff --git a/mod/notification-telegram.rsc b/mod/notification-telegram.rsc
index ce9dc3f1..3f91a755 100644
--- a/mod/notification-telegram.rsc
+++ b/mod/notification-telegram.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch, scheduler
#
# send notifications via Telegram
diff --git a/mod/scriptrunonce.rsc b/mod/scriptrunonce.rsc
index 714f2773..d28bf8a4 100644
--- a/mod/scriptrunonce.rsc
+++ b/mod/scriptrunonce.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# download script and run it once
# https://rsc.eworm.de/doc/mod/scriptrunonce.md
diff --git a/mod/ssh-keys-import.rsc b/mod/ssh-keys-import.rsc
index d1cc4fa3..b2da7770 100644
--- a/mod/ssh-keys-import.rsc
+++ b/mod/ssh-keys-import.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# import ssh keys for public key authentication
# https://rsc.eworm.de/doc/mod/ssh-keys-import.md
@@ -40,9 +40,8 @@
:local FingerPrintMD5 [ :convert from=base64 transform=md5 to=hex ($KeyVal->1) ];
- :local RegEx ("\\bmd5=" . $FingerPrintMD5 . "\\b");
:if ([ :len [ /user/ssh-keys/find where user=$User \
- (key-owner~$RegEx or info~$RegEx) ] ] > 0) do={
+ info~("\\bmd5=" . $FingerPrintMD5 . "\\b") ] ] > 0) do={
$LogPrint warning $0 ("The ssh public key (MD5:" . $FingerPrintMD5 . \
") is already available for user '" . $User . "'.");
:return false;
diff --git a/mode-button.rsc b/mode-button.rsc
index 343878d5..698f2e41 100644
--- a/mode-button.rsc
+++ b/mode-button.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, scheduler
#
# act on multiple mode and reset button presses
diff --git a/netwatch-dns.rsc b/netwatch-dns.rsc
index 9531d4ad..2406dad5 100644
--- a/netwatch-dns.rsc
+++ b/netwatch-dns.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2022-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch
#
# monitor and manage dns/doh with netwatch
# https://rsc.eworm.de/doc/netwatch-dns.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -26,15 +25,13 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local SettleTime (5m30s - [ /system/resource/get uptime ]);
:if ($SettleTime > 0s) do={
$LogPrint info $ScriptName ("System just booted, giving netwatch " . $SettleTime . " to settle.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:local DnsServers ({});
@@ -89,8 +86,7 @@
:if ($DohCurrent = $HostInfo->"doh-url" && [ $IsDNSResolving ] = true) do={
$LogPrint debug $ScriptName ("Current DoH server is still up and resolving: " . $DohCurrent);
- :set ExitOK true;
- :error true;
+ :exit;
}
:set ($DohServers->[ :len $DohServers ]) $HostInfo;
@@ -125,24 +121,23 @@
} do={
$LogPrint warning $ScriptName ("Request to DoH server " . ($DohServer->"doh-url") . \
" failed: " . $Err);
+ :continue;
}
- :if ($Data != false) do={
- :if ([ :typeof [ :find $Data "doh-check-OK" ] ] = "num") do={
- /ip/dns/set use-doh-server=($DohServer->"doh-url") verify-doh-cert=yes;
- :if ([ /certificate/settings/get crl-use ] = true) do={
- $LogPrintOnce warning $ScriptName ("Configured to use CRL, that can cause severe issue!");
- }
- /ip/dns/cache/flush;
- $LogPrint info $ScriptName ("Setting DoH server: " . ($DohServer->"doh-url"));
- :set ExitOK true;
- :error true;
- } else={
- $LogPrint warning $ScriptName ("Received unexpected response from DoH server: " . \
+ :if ([ :typeof [ :find $Data "doh-check-OK" ] ] != "num") do={
+ $LogPrint warning $ScriptName ("Received unexpected response from DoH server: " . \
($DohServer->"doh-url"));
- }
+ :continue;
}
+
+ /ip/dns/set use-doh-server=($DohServer->"doh-url") verify-doh-cert=yes;
+ :if ([ /certificate/settings/get crl-use ] = true) do={
+ $LogPrintOnce warning $ScriptName ("Configured to use CRL, that can cause severe issue!");
+ }
+ /ip/dns/cache/flush;
+ $LogPrint info $ScriptName ("Setting DoH server: " . ($DohServer->"doh-url"));
+ :exit;
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index d9ab5446..342dfdb5 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# monitor netwatch and send notifications
# https://rsc.eworm.de/doc/netwatch-notify.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -80,8 +79,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
@@ -225,5 +223,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/ospf-to-leds.rsc b/ospf-to-leds.rsc
index 784fcdd8..3be09890 100644
--- a/ospf-to-leds.rsc
+++ b/ospf-to-leds.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2020-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# visualize ospf instance state via leds
# https://rsc.eworm.de/doc/ospf-to-leds.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -20,8 +19,7 @@
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:foreach Instance in=[ /routing/ospf/instance/find where comment~"^ospf-to-leds," ] do={
@@ -45,5 +43,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/packages-update.rsc b/packages-update.rsc
index 304a3683..90384c9e 100644
--- a/packages-update.rsc
+++ b/packages-update.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2019-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, scheduler
#
# download packages and reboot for installation
# https://rsc.eworm.de/doc/packages-update.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -59,28 +58,24 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ :len [ /system/scheduler/find where name="running-from-backup-partition" ] ] > 0) do={
$LogPrint warning $ScriptName ("Running from backup partition, refusing to act.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Update [ /system/package/update/get ];
:if ([ :typeof ($Update->"latest-version") ] = "nothing") do={
$LogPrint warning $ScriptName ("Latest version is not known.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ($Update->"installed-version" = $Update->"latest-version") do={
$LogPrint info $ScriptName ("Version " . $Update->"latest-version" . " is already installed.");
- :set ExitOK true;
- :error true;
+ :exit;
}
:local RunOrder ({});
@@ -111,13 +106,11 @@
$LogPrint info $ScriptName ("User requested to continue anyway.");
} else={
$LogPrint info $ScriptName ("Canceled update...");
- :set ExitOK true;
- :error false;
+ :exit;
}
} else={
$LogPrint warning $ScriptName ("Canceled non-interactive update.");
- :set ExitOK true;
- :error false;
+ :exit;
}
}
}
@@ -136,8 +129,7 @@
}
} else={
$LogPrint warning $ScriptName ("Not installing downgrade automatically.");
- :set ExitOK true;
- :error false;
+ :exit;
}
}
@@ -145,8 +137,7 @@
:local PkgName [ /system/package/get $Package name ];
:if ([ $DownloadPackage $PkgName ($Update->"latest-version") ] = false) do={
$LogPrint error $ScriptName ("Download for package " . $PkgName . " failed, update aborted.");
- :set ExitOK true;
- :error false;
+ :exit;
}
}
@@ -160,14 +151,12 @@
:put "Do you want to (s)chedule reboot or (r)eboot now? [s/R]";
:if (([ /terminal/inkey timeout=60 ] % 32) = 19) do={
$Schedule $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
} else={
:if ($PackagesUpdateDeferReboot = true || [ :totime $PackagesUpdateDeferReboot ] >= 1d) do={
$Schedule $ScriptName;
- :set ExitOK true;
- :error true;
+ :exit;
}
}
@@ -175,5 +164,5 @@
:delay 1s;
/system/reboot;
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/ppp-on-up.rsc b/ppp-on-up.rsc
index 79b83861..50ab65de 100644
--- a/ppp-on-up.rsc
+++ b/ppp-on-up.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2013-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# run scripts on ppp up
# https://rsc.eworm.de/doc/ppp-on-up.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -21,8 +20,7 @@
:if ([ :typeof $Interface ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from ppp on-up script hook.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local IntName [ /interface/get $Interface name ];
@@ -40,5 +38,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/sms-action.rsc b/sms-action.rsc
index 12d4cc20..8741d6f6 100644
--- a/sms-action.rsc
+++ b/sms-action.rsc
@@ -3,12 +3,11 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# run action on received SMS
# https://rsc.eworm.de/doc/sms-action.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -24,8 +23,7 @@
:if ([ :typeof $Action ] = "nothing") do={
$LogPrint error $ScriptName ("This script is supposed to run from SMS hook with action=...");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local Code ($SmsAction->$Action);
@@ -37,5 +35,5 @@
$LogPrint warning $ScriptName ("The code for action '" . $Action . "' failed syntax validation!");
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/sms-forward.rsc b/sms-forward.rsc
index 9f3d2558..9b196409 100644
--- a/sms-forward.rsc
+++ b/sms-forward.rsc
@@ -4,12 +4,11 @@
# Anatoly Bubenkov
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
#
# forward SMS to e-mail
# https://rsc.eworm.de/doc/sms-forward.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -29,14 +28,12 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
:if ([ /tool/sms/get receive-enabled ] = false) do={
$LogPrintOnce warning $ScriptName ("Receiving of SMS is not enabled.");
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -45,8 +42,7 @@
:if ([ /interface/lte/get ($Settings->"port") running ] != true) do={
$LogPrint info $ScriptName ("The LTE interface is not in running state, skipping.");
- :set ExitOK true;
- :error true;
+ :exit;
}
# forward SMS in a loop
@@ -107,5 +103,5 @@
}
}
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/telegram-chat.rsc b/telegram-chat.rsc
index c0fa5c16..9bd4c496 100644
--- a/telegram-chat.rsc
+++ b/telegram-chat.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2023-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, fetch
#
# use Telegram to chat with your Router and send commands
# https://rsc.eworm.de/doc/telegram-chat.md
-:local ExitOK false;
:onerror Err {
:global GlobalConfigReady; :global GlobalFunctionsReady;
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
@@ -48,8 +47,7 @@
:global WaitFullyConnected;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :set ExitOK true;
- :error false;
+ :exit;
}
$WaitFullyConnected;
@@ -63,34 +61,31 @@
:if ([ $CertificateAvailable "Go Daddy Root Certificate Authority - G2" "fetch" ] = false) do={
$LogPrint warning $ScriptName ("Downloading required certificate failed.");
- :set ExitOK true;
- :error false;
+ :exit;
}
$RandomDelay $TelegramRandomDelay;
:local Data false;
:for I from=1 to=4 do={
- :if ($Data = false) do={
- :onerror Err {
- :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
- ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
- $TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
- :set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
- } do={
- :if ($I < 4) do={
- $LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
- :set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ];
- :delay (($I * $I) . "s");
- }
+ :onerror Err {
+ :set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
+ ("https://api.telegram.org/bot" . $TelegramTokenId . "/getUpdates?offset=" . \
+ $TelegramChatOffset->0 . "&allowed_updates=%5B%22message%22%5D") as-value ]->"data");
+ :set TelegramRandomDelay [ $MAX 0 ($TelegramRandomDelay - 1) ];
+ :break;
+ } do={
+ :if ($I < 4) do={
+ $LogPrint debug $ScriptName ("Fetch failed, " . $I . ". try: " . $Err);
+ :set TelegramRandomDelay [ $MIN 15 ($TelegramRandomDelay + 5) ];
+ :delay (($I * $I) . "s");
}
}
}
:if ($Data = false) do={
$LogPrint warning $ScriptName ("Failed getting updates.");
- :set ExitOK true;
- :error false;
+ :exit;
}
:local JSON [ :deserialize from=json value=$Data ];
@@ -119,7 +114,6 @@
}
:if ($Trusted = true) do={
- :local Done false;
:if ($Command = "?") do={
$LogPrint info $ScriptName ("Sending notice for update " . $UpdateID . ".");
$SendTelegram2 ({ origin=$ScriptName; chatid=($Chat->"id"); silent=true; \
@@ -127,9 +121,9 @@
subject=([ $SymbolForNotification "speech-balloon" ] . "Telegram Chat"); \
message=([ $IfThenElse ([ :len ($From->"first_name") ] > 0) ("Hello " . ($From->"first_name") . "!\n\n") ] . \
"Online" . [ $IfThenElse $TelegramChatActive " (and active!)" ] . ", awaiting your commands!") });
- :set Done true;
+ :continue;
}
- :if ($Done = false && [ :pick $Command 0 1 ] = "!") do={
+ :if ([ :pick $Command 0 1 ] = "!") do={
:if ($Command ~ ("^! *(" . [ $EscapeForRegEx $Identity ] . "|@" . $TelegramChatGroups . ")\$")) do={
:set TelegramChatActive true;
} else={
@@ -137,17 +131,16 @@
}
$LogPrint info $ScriptName ("Now " . [ $IfThenElse $TelegramChatActive "active" "passive" ] . \
" from update " . $UpdateID . "!");
- :set Done true;
+ :continue;
}
- :if ($Done = false && ($IsMyReply = 1 || ($IsAnyReply = false && \
+ :if (($IsMyReply = 1 || ($IsAnyReply = false && \
$TelegramChatActive = true)) && [ :len $Command ] > 0) do={
:if ([ $ValidateSyntax $Command ] = true) do={
:local State "";
:local File ("tmpfs/telegram-chat/" . [ $GetRandom20CharAlNum 6 ]);
:if ([ $MkDir "tmpfs/telegram-chat" ] = false) do={
$LogPrint error $ScriptName ("Failed creating directory!");
- :set ExitOK true;
- :error false;
+ :exit;
}
$LogPrint info $ScriptName ("Running command from update " . $UpdateID . ": " . $Command);
:execute script=(":do {\n" . $Command . "\n} on-error={ /file/add name=\"" . $File . ".failed\" };" . \
@@ -197,5 +190,5 @@
:set TelegramChatOffset ([ :pick $TelegramChatOffset 1 3 ], \
[ $IfThenElse ($UpdateID >= $TelegramChatOffset->2) ($UpdateID + 1) ($TelegramChatOffset->2) ]);
} do={
- :global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
+ :global ExitOnError; $ExitOnError [ :jobname ] $Err;
}
diff --git a/unattended-lte-firmware-upgrade.rsc b/unattended-lte-firmware-upgrade.rsc
index c2471a81..197c6771 100644
--- a/unattended-lte-firmware-upgrade.rsc
+++ b/unattended-lte-firmware-upgrade.rsc
@@ -3,7 +3,7 @@
# Copyright (c) 2018-2026 Christian Hesse
# https://rsc.eworm.de/COPYING.md
#
-# requires RouterOS, version=7.19
+# requires RouterOS, version=7.22
# requires device-mode, scheduler
#
# schedule unattended lte firmware upgrade
diff --git a/update-gre-address.rsc b/update-gre-address.rsc
index b8f0134f..a1a12f60 100644
--- a/update-gre-address.rsc
+++ b/update-gre-address.rsc
@@ -3,13 +3,12 @@
# Copyright (c) 2013-2026 Christian Hesse
# 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;
}
diff --git a/update-tunnelbroker.rsc b/update-tunnelbroker.rsc
index 215dafa0..6d7e910d 100644
--- a/update-tunnelbroker.rsc
+++ b/update-tunnelbroker.rsc
@@ -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;
}