mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-03-01 11:39:36 +00:00
Compare commits
71 commits
e27bfbdfe5
...
a853e172fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a853e172fa | ||
|
|
3394f0a140 | ||
|
|
d3fb2ab982 | ||
|
|
7bf523275a | ||
|
|
b1e4e89585 | ||
|
|
9f005a16a1 | ||
|
|
3b73af9559 | ||
|
|
99cf486b8e | ||
|
|
2e2f3c4b1a | ||
|
|
db880aea76 | ||
|
|
fe5f28ea6c | ||
|
|
2a321c430a | ||
|
|
2e71b055db | ||
|
|
b3c2088ee9 | ||
|
|
c13a22e15c | ||
|
|
9312f677fe | ||
|
|
3425354157 | ||
|
|
6aa8677836 | ||
|
|
f0922f6433 | ||
|
|
faa938bdf9 | ||
|
|
7dde89f9c4 | ||
|
|
6712629a47 | ||
|
|
db1d59a497 | ||
|
|
2e3af47cb3 | ||
|
|
bde037d58a | ||
|
|
515cf76739 | ||
|
|
e842e1edd2 | ||
|
|
3de1e51543 | ||
|
|
b683d4391f | ||
|
|
20e1dde866 | ||
|
|
915db5e24f | ||
|
|
7e5aa7f553 | ||
|
|
d84023959f | ||
|
|
1ed29c102b | ||
|
|
91caf541e5 | ||
|
|
715685397b | ||
|
|
ed2309e280 | ||
|
|
a677f94d83 | ||
|
|
03cca390ec | ||
|
|
af9d2d4f48 | ||
|
|
74d5363dfc | ||
|
|
e0dba7ccb4 | ||
|
|
56c9832d42 | ||
|
|
1a3071c10f | ||
|
|
3cc31fc0d9 | ||
|
|
b131509509 | ||
|
|
155421b37e | ||
|
|
95972e7297 | ||
|
|
8d2b1d0329 | ||
|
|
2bece543ab | ||
|
|
8550612804 | ||
|
|
a7783ace7f | ||
|
|
d6b55ec916 | ||
|
|
ba572130cf | ||
|
|
04d7d1b22c | ||
|
|
e20edd55b9 | ||
|
|
c81dd7103c | ||
|
|
0da130add0 | ||
|
|
810c16ed9f | ||
|
|
f41a2eee9d | ||
|
|
8fb073e29e | ||
|
|
20524a5522 | ||
|
|
d231f29e02 | ||
|
|
ca5046c6ec | ||
|
|
e86c6ccdff | ||
|
|
5e8e468e61 | ||
|
|
f86d1aa1e9 | ||
|
|
59aabbfbb4 | ||
|
|
96b3cd9d96 | ||
|
|
6aa36e3c95 | ||
|
|
15e47baadb |
136 changed files with 558 additions and 767 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
2
DEBUG.md
2
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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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,10 +23,9 @@ 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") && \
|
||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CertCommonName . "\" ] ]") ]] > 0)) do={
|
||||
[ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
|
||||
:put "Importing certificate...";
|
||||
/tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value;
|
||||
:delay 1s;
|
||||
|
|
|
|||
BIN
README.d/00-builtin-trust-store.avif
Normal file
BIN
README.d/00-builtin-trust-store.avif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
33
README.md
33
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!
|
||||
|
|
@ -97,17 +97,26 @@ including demonstration recorded live at [MUM Europe
|
|||
|
||||
### The long way in detail
|
||||
|
||||
The update script does server certificate verification, so first step is to
|
||||
download the certificates.
|
||||
The update script does server certificate verification, so first step is
|
||||
to establish trust.
|
||||
|
||||
> 💡️ **Hint**: RouterOS 7.19 comes with a builtin certificate store. You
|
||||
> can skip the steps regarding certificate download and import and jump
|
||||
> to [installation of scripts](#installation-of-scripts) if you set the
|
||||
> trust for these builtin trust anchors:
|
||||
> `/certificate/settings/set builtin-trust-anchors=trusted;`
|
||||
> With RouterOS 7.21 the functionality was changed. Set this at minimum,
|
||||
> but make sure not to drop other targets:
|
||||
> `/certificate/settings/set builtin-trust-store=fetch;`
|
||||
#### Builtin trust store
|
||||
|
||||
RouterOS comes with a builtin trust store with several CA certificates.
|
||||
If you intend **not** to trust this store jump to
|
||||
[download and import certificate](#download-and-import-certificate) now.
|
||||
|
||||
Select the `fetch` command to trust these builtin certificates at
|
||||
least, but make sure not to drop other targets:
|
||||
|
||||
/certificate/settings/set builtin-trust-store=fetch;
|
||||
|
||||

|
||||
|
||||
You can skip the steps regarding certificate download and import and jump
|
||||
to [installation of scripts](#installation-of-scripts) now.
|
||||
|
||||
#### Download and import certificate
|
||||
|
||||
If you intend to download the scripts from a
|
||||
different location (for example from github.com) install the corresponding
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2018-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2018-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2018-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2018-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=40
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=20
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=70
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,13 +4,12 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=50
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade.capsman
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade%TEMPL%
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,14 +5,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade.wifi
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@
|
|||
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
# 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) \
|
||||
|
|
@ -55,9 +54,17 @@
|
|||
"' (file '" . $CertFileName . "')...");
|
||||
|
||||
:do {
|
||||
/tool/fetch check-certificate=yes-without-crl http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
||||
($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value;
|
||||
$WaitForFile $CertFileName;
|
||||
:onerror Err {
|
||||
/tool/fetch check-certificate=yes-without-crl \
|
||||
http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
||||
($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value;
|
||||
} do={
|
||||
:if ($Err != "Fetch failed with status 404") do={
|
||||
$LogPrint warning $0 ("Failed fetching certificate: " . $Err);
|
||||
}
|
||||
:error false;
|
||||
}
|
||||
$WaitForFile $CertFileName;
|
||||
|
||||
:local DecryptionFailed true;
|
||||
:foreach I,PassPhrase in=$CertRenewPass do={
|
||||
|
|
@ -118,10 +125,7 @@
|
|||
:local Return "";
|
||||
:for I from=0 to=5 do={
|
||||
:set Return ($Return . [ $ParseKeyValueStore ($CertVal->"issuer") ]->"CN");
|
||||
:local CertSettings [ /certificate/settings/get ];
|
||||
:if (([ :len ($CertSettings->"builtin-trust-anchors") ] > 0 || \
|
||||
[ :len ($CertSettings->"builtin-trust-store") ] > 0) && \
|
||||
[[ :parse (":return [ :len [ /certificate/builtin/find where skid=\"" . ($CertVal->"akid") . "\" ] ]") ]] > 0) do={
|
||||
:if ([ :len [ /certificate/builtin/find where skid=($CertVal->"akid") ] ] > 0) do={
|
||||
:return $Return;
|
||||
}
|
||||
:do {
|
||||
|
|
@ -153,8 +157,7 @@
|
|||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
:exit;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
|
|
@ -166,7 +169,7 @@
|
|||
:do {
|
||||
:if ([ :len $CertRenewUrl ] = 0) do={
|
||||
$LogPrintOnce info $ScriptName ("No CertRenewUrl given.");
|
||||
:error false;
|
||||
:continue;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Attempting to renew certificate '" . ($CertVal->"name") . "'.");
|
||||
|
||||
|
|
@ -253,5 +256,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# check for RouterOS health state - state plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# check for RouterOS health state - temperature plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# check for RouterOS health state - voltage plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2019-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2018-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2025-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@
|
|||
# Copyright (c) 2013-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,14 +4,13 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,11 @@
|
|||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=20
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
|
|
@ -126,5 +124,5 @@
|
|||
}
|
||||
}
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
:global ExitOnError; $ExitOnError [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2022-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,11 @@
|
|||
# Copyright (c) 2023-2026 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.17
|
||||
# requires RouterOS, version=7.19
|
||||
#
|
||||
# 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,3 +7,32 @@
|
|||
#
|
||||
# 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) ];
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue