Compare commits
376 commits
change-131
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ce39b79f69 | ||
|
|
20bf609c44 | ||
|
|
b63e0fcb2f | ||
|
|
1555426687 | ||
|
|
97b99316b2 | ||
|
|
788400c458 | ||
|
|
eb59dd21ca | ||
|
|
79a4b369cb | ||
|
|
f0e6cbcfe1 | ||
|
|
d71ea804b0 | ||
|
|
e148df9e57 | ||
|
|
2f55bfaf00 | ||
|
|
ea6de35699 | ||
|
|
fb343c99e3 | ||
|
|
7be26a0712 | ||
|
|
6d718ec987 | ||
|
|
e341e1c30c | ||
|
|
b43b1b3955 | ||
|
|
1b46a5fd9b | ||
|
|
b13360e4b8 | ||
|
|
c9de6d8579 | ||
|
|
10374afc18 | ||
|
|
0c1d96f89d | ||
|
|
3ccaafd1b3 | ||
|
|
469f783a92 | ||
|
|
33c02e0609 | ||
|
|
6331505dbe | ||
|
|
0c4fb42616 | ||
|
|
f5189b8bd7 | ||
|
|
e2fe653035 | ||
|
|
b11be59b08 | ||
|
|
24de060904 | ||
|
|
14195c51ca | ||
|
|
e833dfcf25 | ||
|
|
512c54bd59 | ||
|
|
3d40b4419d | ||
|
|
a6d4e7e82c | ||
|
|
f6c2225f68 | ||
|
|
53b13b295a | ||
|
|
4eafcaa3ac | ||
|
|
c33eb41c9c | ||
|
|
78f9687558 | ||
|
|
e5de9de391 | ||
|
|
7928c5f054 | ||
|
|
757fa60e6f | ||
|
|
a22b62f588 | ||
|
|
cad104879c | ||
|
|
58da92e36a | ||
|
|
2c92c78b46 | ||
|
|
75633872aa | ||
|
|
dafcc1a0cb | ||
|
|
0199ea8884 | ||
|
|
584e507fd1 | ||
|
|
5715bc7b57 | ||
|
|
1c957dbc6d | ||
|
|
b7b3b43f3b | ||
|
|
df631b987d | ||
|
|
c8759381e9 | ||
|
|
d41f758550 | ||
|
|
e1c561dd91 | ||
|
|
4d0b4a1ff4 | ||
|
|
8af67af462 | ||
|
|
da280586b5 | ||
|
|
2e42f7963c | ||
|
|
fc3beac83b | ||
|
|
fefe11d1e8 | ||
|
|
b156fc43cf | ||
|
|
0fea300fea | ||
|
|
6570a84904 | ||
|
|
63db96bdcc | ||
|
|
88ff031368 | ||
|
|
81ba47a07d | ||
|
|
d748b69142 | ||
|
|
f5f00b70e3 | ||
|
|
4760515add | ||
|
|
d19b90df08 | ||
|
|
ea8ec6b580 | ||
|
|
dbdf295244 | ||
|
|
82020ddd73 | ||
|
|
a8e5b5226b | ||
|
|
4bfb591fa0 | ||
|
|
49d9fb1ffd | ||
|
|
7233dea5bb | ||
|
|
727495d9c4 | ||
|
|
4542c2b19e | ||
|
|
0fb5fd0323 | ||
|
|
dbdc3e4718 | ||
|
|
dafd95d44a | ||
|
|
7b660d0952 | ||
|
|
23d38927bc | ||
|
|
84ba3a463a | ||
|
|
27c92b4382 | ||
|
|
6501c98c82 | ||
|
|
bfe5f20920 | ||
|
|
3024b246b5 | ||
|
|
61f3c26199 | ||
|
|
3ad7ccd3d6 | ||
|
|
eabe3f6e95 | ||
|
|
75e5ddec52 | ||
|
|
44d0c852f1 | ||
|
|
0eb91b6bfa | ||
|
|
87fb70534f | ||
|
|
fcb5347e33 | ||
|
|
aa294b4c67 | ||
|
|
414c83ef81 | ||
|
|
8b19e74736 | ||
|
|
3c8ec5169f | ||
|
|
d921af9a6b | ||
|
|
9421566352 | ||
|
|
ef48b8d39e | ||
|
|
8dc1e1ea6b | ||
|
|
3ef4588601 | ||
|
|
59c9d0ce4b | ||
|
|
378a8978df | ||
|
|
9f2f54b479 | ||
|
|
9a12934202 | ||
|
|
370e81321f | ||
|
|
56e74268b0 | ||
|
|
5f1cbe6de5 | ||
|
|
1ad4d05be8 | ||
|
|
e29ef31eb8 | ||
|
|
bc0227c49b | ||
|
|
43f6c0b975 | ||
|
|
95b675f67e | ||
|
|
d81a786e82 | ||
|
|
aebc4e37da | ||
|
|
b177e298d7 | ||
|
|
106a9bddef | ||
|
|
546e3cdab6 | ||
|
|
c04ee5aadf | ||
|
|
49aef0606b | ||
|
|
32ac10e6ef | ||
|
|
e3ca37ad9a | ||
|
|
dd2854e983 | ||
|
|
7addf2e53a | ||
|
|
1f5aea9fca | ||
|
|
867e504c94 | ||
|
|
90a148a9d8 | ||
|
|
3b0ea3a238 | ||
|
|
719079c5c1 | ||
|
|
563aeb8f71 | ||
|
|
299b34883f | ||
|
|
ed18444578 | ||
|
|
66ab2a8511 | ||
|
|
27144a428a | ||
|
|
6e7f311269 | ||
|
|
6567a94a4f | ||
|
|
631f63836b | ||
|
|
828f68be3c | ||
|
|
078d5368fb | ||
|
|
18fcecd211 | ||
|
|
d5a50d824f | ||
|
|
6920842d15 | ||
|
|
b8841a7135 | ||
|
|
b75a35417a | ||
|
|
bf11489d11 | ||
|
|
5e60d2e1b7 | ||
|
|
5ead61cb62 | ||
|
|
71316f7377 | ||
|
|
02cc581aff | ||
|
|
453d80a121 | ||
|
|
9474102c62 | ||
|
|
996602bfe9 | ||
|
|
72db13c0ab | ||
|
|
0431b02324 | ||
|
|
7be415d0ed | ||
|
|
b7923485bd | ||
|
|
ac62b8f24f | ||
|
|
39c5aeda13 | ||
|
|
7b760d9fa4 | ||
|
|
632d294a98 | ||
|
|
61dee21776 | ||
|
|
96fa76f07d | ||
|
|
f8058eaf71 | ||
|
|
36c87c91ea | ||
|
|
7484663b92 | ||
|
|
231be730ae | ||
|
|
1239ac3104 | ||
|
|
1b7458ac95 | ||
|
|
26dbf5805a | ||
|
|
b938847030 | ||
|
|
38b5fbab9c | ||
|
|
c70b6a8eb3 | ||
|
|
08ff07d037 | ||
|
|
5281b4ba02 | ||
|
|
1dda59034e | ||
|
|
500054535c | ||
|
|
a446f31262 | ||
|
|
d4acc5aa59 | ||
|
|
ccf17a438c | ||
|
|
e8b1e19b28 | ||
|
|
98791f48fd | ||
|
|
ce2d090e99 | ||
|
|
665516b33d | ||
|
|
d9693f4d5f | ||
|
|
6c990079a6 | ||
|
|
303c393900 | ||
|
|
db508ddcd1 | ||
|
|
9e3729c279 | ||
|
|
b98b245714 | ||
|
|
191cc1b952 | ||
|
|
3ada3055ff | ||
|
|
ef3ce7cc6c | ||
|
|
8212bd6c95 | ||
|
|
ba39c29648 | ||
|
|
6bee467550 | ||
|
|
d1b9b1b410 | ||
|
|
a7878d664f | ||
|
|
b66332eb46 | ||
|
|
8c8c75ca66 | ||
|
|
1e2ca3d214 | ||
|
|
5310673152 | ||
|
|
009a6bd762 | ||
|
|
8231c3e833 | ||
|
|
d70efe910a | ||
|
|
c311e58d99 | ||
|
|
42bcc63d29 | ||
|
|
bceabebf9c | ||
|
|
519cb85e28 | ||
|
|
e51191035b | ||
|
|
210ef26b93 | ||
|
|
f8a55860af | ||
|
|
1788c05998 | ||
|
|
3866ea1923 | ||
|
|
73e0ac75f1 | ||
|
|
48bcf8ee6e | ||
|
|
ee030740cb | ||
|
|
4968b79fc1 | ||
|
|
d4ea0e18a7 | ||
|
|
e89867be15 | ||
|
|
adbefca0e4 | ||
|
|
e76ae11b02 | ||
|
|
a78fe98fd0 | ||
|
|
aac723e2a1 | ||
|
|
ede351f47e | ||
|
|
de9dee83be | ||
|
|
be05480071 | ||
|
|
1994b23e46 | ||
|
|
81f59f9894 | ||
|
|
1927dc505a | ||
|
|
eeb76c227c | ||
|
|
5450618723 | ||
|
|
bdc15eaefb | ||
|
|
34172e4c78 | ||
|
|
d89a369485 | ||
|
|
05cb87f475 | ||
|
|
b7ce6aee71 | ||
|
|
495232b299 | ||
|
|
da7a031081 | ||
|
|
5db686a15c | ||
|
|
177a1e798a | ||
|
|
1fe90a6e9a | ||
|
|
82de8bd935 | ||
|
|
5b9031ccca | ||
|
|
a6fd6bd80c | ||
|
|
8c5bd8f5e2 | ||
|
|
8e12453058 | ||
|
|
ff00c27f99 | ||
|
|
f7b96aa3e9 | ||
|
|
90cfa83d95 | ||
|
|
923a6385bf | ||
|
|
590030d391 | ||
|
|
c8d423c7d5 | ||
|
|
87cde2cc2f | ||
|
|
f9a6916827 | ||
|
|
bf322781d1 | ||
|
|
9d17beef03 | ||
|
|
91c8d30655 | ||
|
|
451df78dd8 | ||
|
|
00487f93d4 | ||
|
|
dc7642c1fd | ||
|
|
172d43288e | ||
|
|
c909bef613 | ||
|
|
268743ef6b | ||
|
|
95030b9b74 | ||
|
|
2c4053cff5 | ||
|
|
52b5490bab | ||
|
|
36b81fab94 | ||
|
|
ed6739b8bc | ||
|
|
0d69f8952c | ||
|
|
09e8b1d219 | ||
|
|
6548f83ef4 | ||
|
|
e851cd5ad0 | ||
|
|
794525b706 | ||
|
|
4d8dce9769 | ||
|
|
08ad4e5194 | ||
|
|
53b6f7720e | ||
|
|
1beda3aa7c | ||
|
|
5b09469cc6 | ||
|
|
a224fbc424 | ||
|
|
e5c3aeb5cd | ||
|
|
ae655646ba | ||
|
|
f1533b8962 | ||
|
|
a545d0d39e | ||
|
|
04172f0438 | ||
|
|
d97f63fa5a | ||
|
|
6c8fa8e639 | ||
|
|
1f526b3561 | ||
|
|
0837391c38 | ||
|
|
9c945b1a32 | ||
|
|
084c246ef0 | ||
|
|
31dfdf7e62 | ||
|
|
d213369e73 | ||
|
|
c5740c2328 | ||
|
|
af942d90d3 | ||
|
|
3c0852d6b8 | ||
|
|
3506f71071 | ||
|
|
a6584170c3 | ||
|
|
3169270dbd | ||
|
|
e803f8b3c0 | ||
|
|
d022c87651 | ||
|
|
7229c756af | ||
|
|
07c9576377 | ||
|
|
435f70999c | ||
|
|
71c58c6afb | ||
|
|
f7f50a9d45 | ||
|
|
82e3e7a9fc | ||
|
|
85a7a16c15 | ||
|
|
c955c94098 | ||
|
|
98e62e3eac | ||
|
|
5135e836b8 | ||
|
|
f75e701be3 | ||
|
|
f2576cf558 | ||
|
|
1776b8f50b | ||
|
|
c2c72818de | ||
|
|
60aa553219 | ||
|
|
c708832b69 | ||
|
|
734a80ba82 | ||
|
|
41b19b045a | ||
|
|
fe52bd4a0a | ||
|
|
d23d05f2ea | ||
|
|
09dcd51feb | ||
|
|
9737bfa46a | ||
|
|
21fa46fdf6 | ||
|
|
f4c97559b3 | ||
|
|
917be4b425 | ||
|
|
48fd281c1d | ||
|
|
90632f223a | ||
|
|
3e9a7ea75a | ||
|
|
f17502d3d0 | ||
|
|
d360cc05be | ||
|
|
f952ea73e6 | ||
|
|
342d459436 | ||
|
|
c28574b8f4 | ||
|
|
32474c751f | ||
|
|
a017f24224 | ||
|
|
209c37664b | ||
|
|
8f43b802bc | ||
|
|
22d93d0708 | ||
|
|
511184a4a7 | ||
|
|
8ea7805541 | ||
|
|
380b3b3137 | ||
|
|
6fbafe76ba | ||
|
|
075a9bd6c4 | ||
|
|
2b758b83fd | ||
|
|
2fd0d27447 | ||
|
|
8f75d542f3 | ||
|
|
8074305b92 | ||
|
|
f2ca62aed0 | ||
|
|
a26f78329a | ||
|
|
ee928605df | ||
|
|
7cf0c5b205 | ||
|
|
68f61ae622 | ||
|
|
2d42fed621 | ||
|
|
0101b56bff | ||
|
|
f09fa83105 | ||
|
|
3fd1896ad6 | ||
|
|
78dfc568c1 | ||
|
|
35d3c058b8 | ||
|
|
25135b64e5 | ||
|
|
235737c232 | ||
|
|
1bc6f9c45c | ||
|
|
64bc9f73f7 | ||
|
|
eab9b28cd2 | ||
|
|
ce1b635eb2 | ||
|
|
f3f7d3edc0 |
|
|
@ -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)
|
||||
|
||||
|
|
@ -22,13 +22,13 @@ for testing.
|
|||
|
||||
To install a single script from `next` branch:
|
||||
|
||||
$ScriptInstallUpdate script-name "url-suffix=?h=next";
|
||||
$ScriptInstallUpdate script-name "base-url=https://rsc.eworm.de/next/";
|
||||
|
||||
## Switch existing script
|
||||
|
||||
Alternatively switch an existing script to update from `next` branch:
|
||||
|
||||
/system/script/set comment="url-suffix=?h=next" script-name;
|
||||
/system/script/set comment="base-url=https://rsc.eworm.de/next/" script-name;
|
||||
$ScriptInstallUpdate;
|
||||
|
||||
## Switch installation
|
||||
|
|
@ -36,7 +36,7 @@ Alternatively switch an existing script to update from `next` branch:
|
|||
Last but not least - to switch the complete installation to the `next`
|
||||
branch edit `global-config-overlay` and add:
|
||||
|
||||
:global ScriptUpdatesUrlSuffix "?h=next";
|
||||
:global ScriptUpdatesBaseUrl "https://rsc.eworm.de/next/";
|
||||
|
||||
... then reload the configuration and update:
|
||||
|
||||
|
|
|
|||
BIN
CERTIFICATES.d/01-dialog-A.avif
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
CERTIFICATES.d/02-dialog-B.avif
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
CERTIFICATES.d/03-window.avif
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
CERTIFICATES.d/04-certificate.avif
Normal file
|
After Width: | Height: | Size: 22 KiB |
82
CERTIFICATES.md
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
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://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
[⬅️ Go back to main README](README.md)
|
||||
|
||||
All well known desktop, mobile and server operating systems come with a
|
||||
certificate store that is populated with a set of well known and trusted
|
||||
certificates, acting as *trust anchors*.
|
||||
|
||||
However RouterOS does not, still sometimes a specific certificate is
|
||||
required to properly verify a chain of trust. One example is downloading
|
||||
the scripts from this repository with `fetch` command, thus the very
|
||||
first step of [installation](README.md#the-long-way-in-detail) is importing
|
||||
the certificate.
|
||||
|
||||
The scripts can install additional certificates when required. This happens
|
||||
from this repository if available, or from [mkcert.org](https://mkcert.org)
|
||||
as a fallback.
|
||||
|
||||
Get the certificate's CommonName
|
||||
--------------------------------
|
||||
|
||||
But how to determine what certificate may be required? Often easiest way
|
||||
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*".
|
||||
|
||||

|
||||
|
||||
The dialog will change, click "*More information*".
|
||||
|
||||

|
||||
|
||||
A new window opens, click the button "*View Certificate*". (That window
|
||||
can be closed now.)
|
||||
|
||||

|
||||
|
||||
A new tab opens, showing information on the server certificate and its
|
||||
chain of trust. The leftmost certificate is what we are interested in.
|
||||
|
||||

|
||||
|
||||
Now we know that "`ISRG Root X2`" is required, some scripts need just
|
||||
that information.
|
||||
|
||||
Import a certificate by CommonName
|
||||
----------------------------------
|
||||
|
||||
Running the function `$CertificateAvailable` with that name as parameter
|
||||
makes sure the certificate is available in the device's store:
|
||||
|
||||
$CertificateAvailable "ISRG Root X2";
|
||||
|
||||
If the certificate is actually available already nothing happens, and there
|
||||
is no output. Otherwise the certificate is downloaded and imported.
|
||||
|
||||
If importing a certificate with that exact name fails a warning is given
|
||||
and nothing is actually imported.
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
* [Download, import and update firewall address-lists](doc/fw-addr-lists.md)
|
||||
* [Manage DNS and DoH servers from netwatch](doc/netwatch-dns.md)
|
||||
* [Send notifications via Matrix](doc/mod/notification-matrix.md)
|
||||
* [Send notifications via Ntfy](doc/mod/notification-ntfy.md)
|
||||
|
||||
---
|
||||
[⬅️ Go back to main README](README.md)
|
||||
[⬆️ Go back to top](#top)
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -20,7 +20,9 @@ for details!
|
|||
* [Anatoly Bubenkov](mailto:bubenkoff@gmail.com) (@bubenkoff)
|
||||
* [Ben Harris](mailto:mail@bharr.is) (@bharrisau)
|
||||
* [Daniel Ziegenberg](mailto:daniel@ziegenberg.at) (@ziegenberg)
|
||||
* [Ignacio Serrano](mailto:ignic@ignic.com) (@ignic)
|
||||
* [Michael Gisbers](mailto:michael@gisbers.de) (@mgisbers)
|
||||
* [Miquel Bonastre](mailto:mbonastre@yahoo.com) (@mbonastre)
|
||||
* @netravnen
|
||||
* [netztrip](mailto:dave-tvg@netztrip.de) (@netztrip)
|
||||
* [Stefan Müller](mailto:stefan.mueller.83@gmail.com) (@PackElend)
|
||||
|
|
@ -37,6 +39,7 @@ Add yourself to the list,
|
|||
* Daniel Ziegenberg (@ziegenberg)
|
||||
* Devin Dean (@dd2594gh)
|
||||
* Evaldo Gardenal
|
||||
* Florian Estraviz
|
||||
* Giorgio Bikos
|
||||
* Harold Schoemaker
|
||||
* Hugo BV
|
||||
|
|
@ -47,6 +50,7 @@ Add yourself to the list,
|
|||
* Marek Čábák
|
||||
* Oleksandr Yukhymchuk
|
||||
* Peter Holtkamp
|
||||
* Peter Ponzel
|
||||
* Reiner Vehrenkamp
|
||||
* Richard Österreicher
|
||||
* Simon Hitzemann
|
||||
|
|
|
|||
63
DEBUG.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
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://t.me/routeros_scripts)
|
||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||
|
||||
[⬅️ Go back to main README](README.md)
|
||||
|
||||
Sometimes scripts do not behave as expected. In these cases debug output
|
||||
or logs can help.
|
||||
|
||||
## Debug output
|
||||
|
||||
Run this command in a terminal:
|
||||
|
||||
:set PrintDebug true;
|
||||
|
||||
You will then see debug output when running the script from terminal.
|
||||
|
||||
To revert to default output run:
|
||||
|
||||
:set PrintDebug false;
|
||||
|
||||
### Debug output for specific script
|
||||
|
||||
Even having debug output for a specific script or function only (or a
|
||||
set of) is possible. To enable debug output for `telegram-chat` run:
|
||||
|
||||
:set ($PrintDebugOverride->"telegram-chat") true;
|
||||
|
||||
## Debug logs
|
||||
|
||||
The debug info can go to system log. To make it show up in `memory` run:
|
||||
|
||||
/system/logging/add topics=script,debug action=memory;
|
||||
|
||||
Other actions (`disk`, `email`, `remote` or `support`) can be used as
|
||||
well. I do not recommend using `echo` - use [debug output](#debug-output)
|
||||
instead.
|
||||
|
||||
Disable or remote that setting to restore regular logging.
|
||||
|
||||
## Verbose output
|
||||
|
||||
Specific scripts can generate huge amount of output. These do use a function
|
||||
`$LogPrintVerbose`, which is declared, but has no code, intentionally.
|
||||
|
||||
If you *really* want that output set the function to be the same as
|
||||
`$LogPrint`:
|
||||
|
||||
:set LogPrintVerbose $LogPrint;
|
||||
|
||||
To revert that change just run:
|
||||
|
||||
:set LogPrintVerbose;
|
||||
|
||||
---
|
||||
[⬅️ Go back to main README](README.md)
|
||||
[⬆️ Go back to top](#top)
|
||||
|
|
@ -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)
|
||||
|
||||
|
|
@ -17,13 +17,12 @@ Initial commands
|
|||
Run the complete base installation:
|
||||
|
||||
{
|
||||
/tool/fetch "https://git.eworm.de/cgit/routeros-scripts/plain/certs/ISRG-Root-X2.pem" dst-path="ISRG-Root-X2.pem" as-value;
|
||||
/tool/fetch "https://git.eworm.de/cgit/routeros-scripts/plain/certs/ISRG-Root-X2.pem" dst-path="isrg-root-x2.pem" as-value;
|
||||
:delay 1s;
|
||||
/certificate/import file-name=ISRG-Root-X2.pem passphrase="";
|
||||
/certificate/import file-name="isrg-root-x2.pem" passphrase="";
|
||||
:if ([ :len [ /certificate/find where fingerprint="69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470" ] ] != 1) do={
|
||||
:error "Something is wrong with your certificates!";
|
||||
};
|
||||
/file/remove [ find where name="ISRG-Root-X2.pem" ];
|
||||
:delay 1s;
|
||||
/system/script/set name=("global-config-overlay-" . [ /system/clock/get date ] . "-" . [ /system/clock/get time ]) [ find where name="global-config-overlay" ];
|
||||
:foreach Script in={ "global-config"; "global-config-overlay"; "global-functions" } do={
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.9 KiB |
19
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)
|
||||
|
||||
|
|
@ -34,6 +34,12 @@ Specific scripts may require even newer RouterOS version.
|
|||
> ℹ️ **Info**: The `main` branch is now RouterOS v7 only. If you are still
|
||||
> running RouterOS v6 switch to `routeros-v6` branch!
|
||||
|
||||
Starting with RouterOS 7.17 the
|
||||
[device-mode](https://help.mikrotik.com/docs/spaces/ROS/pages/93749258/Device-mode)
|
||||
has been extended to give more fine-grained control over what features are
|
||||
available. You need to enable `scheduler` and `fetch` at least, specific
|
||||
scripts may require additional features.
|
||||
|
||||
### Hardware
|
||||
|
||||
RouterOS packages increase in size with each release. This becomes a
|
||||
|
|
@ -69,7 +75,7 @@ download the certificates. If you intend to download the scripts from a
|
|||
different location (for example from github.com) install the corresponding
|
||||
certificate chain.
|
||||
|
||||
/tool/fetch "https://git.eworm.de/cgit/routeros-scripts/plain/certs/ISRG-Root-X2.pem" dst-path="ISRG-Root-X2.pem";
|
||||
/tool/fetch "https://git.eworm.de/cgit/routeros-scripts/plain/certs/ISRG-Root-X2.pem" dst-path="isrg-root-x2.pem";
|
||||
|
||||

|
||||
|
||||
|
|
@ -81,7 +87,7 @@ file to your MikroTik device.
|
|||
|
||||
Then we import the certificate.
|
||||
|
||||
/certificate/import file-name=ISRG-Root-X2.pem passphrase="";
|
||||
/certificate/import file-name="isrg-root-x2.pem" passphrase="";
|
||||
|
||||
Do not worry that the command is not shown - that happens because it contains
|
||||
a sensitive property, the passphrase.
|
||||
|
|
@ -90,11 +96,10 @@ a sensitive property, the passphrase.
|
|||
|
||||
For basic verification we rename the certificate and print it by
|
||||
fingerprint. Make sure exactly this one certificate ("*ISRG-Root-X2*")
|
||||
is shown. Also remove the left over file.
|
||||
is shown.
|
||||
|
||||
/certificate/set name="ISRG-Root-X2" [ find where common-name="ISRG Root X2" ];
|
||||
/certificate/print proplist=name,fingerprint where fingerprint="69729b8e15a86efc177a57afb7171dfc64add28c2fca8cf1507e34453ccb1470";
|
||||
/file/remove [ find where name="ISRG-Root-X2.pem" ];
|
||||
|
||||

|
||||
|
||||
|
|
@ -155,7 +160,7 @@ This last step is required when ever you make changes to your configuration.
|
|||
> ℹ️ **Info**: It is recommended to edit the configuration using the command
|
||||
> line interface. If using Winbox on Windows OS, the line endings may be
|
||||
> missing. To fix this run:
|
||||
> `/system/script/set source=[ $Unix2Dos [ get global-config-overlay source ] ] global-config-overlay;`
|
||||
> `/system/script/set source=[ :tocrlf [ get global-config-overlay source ] ] global-config-overlay;`
|
||||
|
||||
Updating scripts
|
||||
----------------
|
||||
|
|
@ -365,7 +370,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
Upstream
|
||||
--------
|
||||
|
||||

|
||||
[](https://rsc.eworm.de/)
|
||||
|
||||
URL:
|
||||
[GitHub.com](https://github.com/eworm-de/routeros-scripts#routeros-scripts)
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: accesslist-duplicates.capsman
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -31,4 +32,6 @@
|
|||
}
|
||||
:set ($Seen->$Mac) 1;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: accesslist-duplicates.local
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -31,4 +32,6 @@
|
|||
}
|
||||
:set ($Seen->$Mac) 1;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: accesslist-duplicates%TEMPL%
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -40,4 +41,6 @@
|
|||
}
|
||||
:set ($Seen->$Mac) 1;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: accesslist-duplicates.wifi
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# print duplicate antries in wireless access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/accesslist-duplicates.md
|
||||
# https://rsc.eworm.de/doc/accesslist-duplicates.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -31,4 +32,6 @@
|
|||
}
|
||||
:set ($Seen->$Mac) 1;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: backup-cloud
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=40
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# upload backup to MikroTik cloud
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-cloud.md
|
||||
# https://rsc.eworm.de/doc/backup-cloud.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -25,6 +26,7 @@
|
|||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RandomDelay;
|
||||
:global RmDir;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
|
|
@ -34,8 +36,17 @@
|
|||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
: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;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
@ -44,6 +55,7 @@
|
|||
|
||||
:if ([ $MkDir ("tmpfs/backup-cloud") ] = false) do={
|
||||
$LogPrint error $ScriptName ("Failed creating directory!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -86,5 +98,7 @@
|
|||
$LogPrint error $ScriptName ("Failed uploading backup for " . $Identity . " to cloud!");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
}
|
||||
/file/remove "tmpfs/backup-cloud";
|
||||
} on-error={ }
|
||||
$RmDir "tmpfs/backup-cloud";
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: backup-email
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=20
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# create and email backup and config file
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-email.md
|
||||
# https://rsc.eworm.de/doc/backup-email.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -39,19 +40,30 @@
|
|||
|
||||
:if ([ :typeof $SendEMail2 ] = "nothing") do={
|
||||
$LogPrint error $ScriptName ("The module for sending notifications via e-mail is not installed.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ($BackupSendBinary != true && \
|
||||
$BackupSendExport != true) do={
|
||||
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
: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;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
@ -69,6 +81,7 @@
|
|||
|
||||
:if ([ $MkDir $DirName ] = false) do={
|
||||
$LogPrint error $ScriptName ("Failed creating directory!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -116,9 +129,12 @@
|
|||
:if ($I >= 120) do={
|
||||
$LogPrint warning $ScriptName ("Files are still available, sending e-mail failed.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
:delay 1s;
|
||||
:set I ($I + 1);
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: backup-partition
|
||||
# Copyright (c) 2022-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2022-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=70
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
# requires device-mode, scheduler
|
||||
#
|
||||
# save configuration to fallback partition
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-partition.md
|
||||
# https://rsc.eworm.de/doc/backup-partition.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -24,29 +26,39 @@
|
|||
:global VersionToNum;
|
||||
|
||||
:local CopyTo do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:local FallbackTo [ :tostr $2 ];
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:local FallbackTo [ :toid $2 ];
|
||||
:local FallbackToName [ :tostr $3 ];
|
||||
|
||||
:global LogPrint;
|
||||
|
||||
:do {
|
||||
/partitions/copy-to $FallbackTo;
|
||||
$LogPrint info $ScriptName ("Copied RouterOS to partition '" . $FallbackTo . "'.");
|
||||
$LogPrint info $ScriptName ("Copied RouterOS to partition '" . $FallbackToName . "'.");
|
||||
:return true;
|
||||
} on-error={
|
||||
$LogPrint error $ScriptName ("Failed copying RouterOS to partition '" . $FallbackTo . "'!");
|
||||
$LogPrint error $ScriptName ("Failed copying RouterOS to partition '" . $FallbackToName . "'!");
|
||||
:return false;
|
||||
}
|
||||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
: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;
|
||||
}
|
||||
|
||||
:if ([ :len [ /partitions/find ] ] < 2) do={
|
||||
$LogPrint error $ScriptName ("Device does not have a fallback partition.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -55,17 +67,27 @@
|
|||
:if ([ :len $ActiveRunning ] < 1) do={
|
||||
$LogPrint error $ScriptName ("Device is not running from active partition.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local FallbackTo [ /partitions/get $ActiveRunning fallback-to ];
|
||||
:local FallbackToName [ /partitions/get $ActiveRunning fallback-to ];
|
||||
:local FallbackTo [ /partition/find where name=$FallbackToName !active ];
|
||||
|
||||
:if ([ :len $FallbackTo ] < 1) do={
|
||||
$LogPrint error $ScriptName ("There is no inactive partition named '" . $FallbackToName . "'.");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ /partitions/get $ActiveRunning version ] != [ /partitions/get $FallbackTo version]) do={
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
|
||||
:put ("The partitions have different RouterOS versions. Copy over to '" . $FallbackTo . "'? [y/N]");
|
||||
:put ("The partitions have different RouterOS versions. Copy over to '" . $FallbackToName . "'? [y/N]");
|
||||
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
|
||||
:if ([ $CopyTo $ScriptName $FallbackTo ] = false) do={
|
||||
:if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
}
|
||||
|
|
@ -73,10 +95,12 @@
|
|||
:local Update [ /system/package/update/get ];
|
||||
:local NumInstalled [ $VersionToNum ($Update->"installed-version") ];
|
||||
:local NumLatest [ $VersionToNum ($Update->"latest-version") ];
|
||||
:local BitMask [ $VersionToNum "255.255zero0" ];
|
||||
:if ($BackupPartitionCopyBeforeFeatureUpdate = true && $NumLatest > 0 && \
|
||||
($NumInstalled & 0xffff0000) != ($NumLatest & 0xffff0000)) do={
|
||||
:if ([ $CopyTo $ScriptName $FallbackTo ] = false) do={
|
||||
($NumInstalled & $BitMask) != ($NumLatest & $BitMask)) do={
|
||||
:if ([ $CopyTo $ScriptName $FallbackTo $FallbackToName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,11 +113,14 @@
|
|||
"[ /partitions/get [ find where running ] name ] . \"'!\")");
|
||||
/partitions/save-config-to $FallbackTo;
|
||||
/system/scheduler/remove "running-from-backup-partition";
|
||||
$LogPrint info $ScriptName ("Saved configuration to partition '" . $FallbackTo . "'.");
|
||||
$LogPrint info $ScriptName ("Saved configuration to partition '" . $FallbackToName . "'.");
|
||||
} on-error={
|
||||
/system/scheduler/remove [ find where name="running-from-backup-partition" ];
|
||||
$LogPrint error $ScriptName ("Failed saving configuration to partition '" . $FallbackTo . "'!");
|
||||
$LogPrint error $ScriptName ("Failed saving configuration to partition '" . $FallbackToName . "'!");
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: backup-upload
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: backup-script, order=50
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
# requires device-mode, fetch
|
||||
#
|
||||
# create and upload backup and config file
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/backup-upload.md
|
||||
# https://rsc.eworm.de/doc/backup-upload.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -33,6 +35,8 @@
|
|||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RandomDelay;
|
||||
:global RmDir;
|
||||
:global RmFile;
|
||||
:global ScriptFromTerminal;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
|
|
@ -43,13 +47,23 @@
|
|||
:if ($BackupSendBinary != true && \
|
||||
$BackupSendExport != true) do={
|
||||
$LogPrint error $ScriptName ("Configured to send neither backup nor config export.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
: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;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = false && $BackupRandomDelay > 0) do={
|
||||
|
|
@ -67,6 +81,7 @@
|
|||
|
||||
:if ([ $MkDir $DirName ] = false) do={
|
||||
$LogPrint error $ScriptName ("Failed creating directory!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +101,7 @@
|
|||
:set Failed 1;
|
||||
}
|
||||
|
||||
/file/remove ($FilePath . ".backup");
|
||||
$RmFile ($FilePath . ".backup");
|
||||
}
|
||||
|
||||
# create configuration export
|
||||
|
|
@ -105,7 +120,7 @@
|
|||
:set Failed 1;
|
||||
}
|
||||
|
||||
/file/remove ($FilePath . ".rsc");
|
||||
$RmFile ($FilePath . ".rsc");
|
||||
}
|
||||
|
||||
# global-config-overlay
|
||||
|
|
@ -126,7 +141,7 @@
|
|||
:set Failed 1;
|
||||
}
|
||||
|
||||
/file/remove ($FilePath . ".conf");
|
||||
$RmFile ($FilePath . ".conf");
|
||||
}
|
||||
|
||||
:local FileInfo do={
|
||||
|
|
@ -157,5 +172,7 @@
|
|||
:if ($Failed = 1) do={
|
||||
:set PackagesUpdateBackupFailure true;
|
||||
}
|
||||
/file/remove $DirName;
|
||||
} on-error={ }
|
||||
$RmDir $DirName;
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-download-packages.capsman
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,10 +22,12 @@
|
|||
:global DownloadPackage;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -35,6 +38,7 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +46,7 @@
|
|||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
|
|
@ -57,7 +62,7 @@
|
|||
:if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \
|
||||
($File->"package-architecture") $PackagePath ] = true) do={
|
||||
:set Updated true;
|
||||
/file/remove $Package;
|
||||
$RmFile ($File->"name");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -73,11 +78,15 @@
|
|||
}
|
||||
|
||||
:if ($Updated = true) do={
|
||||
:local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0);
|
||||
:if ([ :len $Script ] > 0) do={
|
||||
/system/script/run $Script;
|
||||
:local Scripts [ /system/script/find where source~"\n# provides: capsman-rolling-upgrade.capsman\r?\n" ];
|
||||
:if ([ :len $Scripts ] > 0) do={
|
||||
:foreach Script in=$Scripts do={
|
||||
/system/script/run $Script;
|
||||
}
|
||||
} else={
|
||||
/caps-man/remote-cap/upgrade [ find where version!=$InstalledVersion ];
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-download-packages%TEMPL%
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -22,10 +23,12 @@
|
|||
:global DownloadPackage;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -37,6 +40,7 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -44,6 +48,7 @@
|
|||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
|
|
@ -59,7 +64,7 @@
|
|||
:if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \
|
||||
($File->"package-architecture") $PackagePath ] = true) do={
|
||||
:set Updated true;
|
||||
/file/remove $Package;
|
||||
$RmFile ($File->"name");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -83,12 +88,16 @@
|
|||
}
|
||||
|
||||
:if ($Updated = true) do={
|
||||
:local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0);
|
||||
:if ([ :len $Script ] > 0) do={
|
||||
/system/script/run $Script;
|
||||
:local Scripts [ /system/script/find where source~"\n# provides: capsman-rolling-upgrade%TEMPL%\r?\n" ];
|
||||
:if ([ :len $Scripts ] > 0) do={
|
||||
:foreach Script in=$Scripts do={
|
||||
/system/script/run $Script;
|
||||
}
|
||||
} else={
|
||||
/caps-man/remote-cap/upgrade [ find where version!=$InstalledVersion ];
|
||||
/interface/wifi/capsman/remote-cap/upgrade [ find where version!=$InstalledVersion ];
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-download-packages.wifi
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# download and cleanup packages for CAP installation from CAPsMAN
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-download-packages.md
|
||||
# https://rsc.eworm.de/doc/capsman-download-packages.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,10 +22,12 @@
|
|||
:global DownloadPackage;
|
||||
:global LogPrint;
|
||||
:global MkDir;
|
||||
:global RmFile;
|
||||
:global ScriptLock;
|
||||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -35,6 +38,7 @@
|
|||
|
||||
:if ([ :len $PackagePath ] = 0) do={
|
||||
$LogPrint warning $ScriptName ("The CAPsMAN package path is not defined, can not download packages.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -42,6 +46,7 @@
|
|||
:if ([ $MkDir $PackagePath ] = false) do={
|
||||
$LogPrint warning $ScriptName ("Creating directory at CAPsMAN package path (" . \
|
||||
$PackagePath . ") failed!");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$LogPrint info $ScriptName ("Created directory at CAPsMAN package path (" . $PackagePath . \
|
||||
|
|
@ -57,7 +62,7 @@
|
|||
:if ([ $DownloadPackage ($File->"package-name") $InstalledVersion \
|
||||
($File->"package-architecture") $PackagePath ] = true) do={
|
||||
:set Updated true;
|
||||
/file/remove $Package;
|
||||
$RmFile ($File->"name");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -75,11 +80,15 @@
|
|||
}
|
||||
|
||||
:if ($Updated = true) do={
|
||||
:local Script ([ /system/script/find where source~"\n# provides: capsman-rolling-upgrade\n" ]->0);
|
||||
:if ([ :len $Script ] > 0) do={
|
||||
/system/script/run $Script;
|
||||
:local Scripts [ /system/script/find where source~"\n# provides: capsman-rolling-upgrade.wifi\r?\n" ];
|
||||
:if ([ :len $Scripts ] > 0) do={
|
||||
:foreach Script in=$Scripts do={
|
||||
/system/script/run $Script;
|
||||
}
|
||||
} else={
|
||||
/interface/wifi/capsman/remote-cap/upgrade [ find where version!=$InstalledVersion ];
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-rolling-upgrade.capsman
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade
|
||||
# requires RouterOS, version=7.13
|
||||
# provides: capsman-rolling-upgrade.capsman
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# upgrade CAPs one after another
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md
|
||||
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -22,6 +23,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -43,4 +45,6 @@
|
|||
:delay ($Delay . "s");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-rolling-upgrade%TEMPL%
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade
|
||||
# requires RouterOS, version=7.13
|
||||
# provides: capsman-rolling-upgrade%TEMPL%
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# upgrade CAPs one after another
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md
|
||||
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -16,6 +16,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -23,6 +24,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -51,4 +53,6 @@
|
|||
:delay ($Delay . "s");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,21 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: capsman-rolling-upgrade.wifi
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: capsman-rolling-upgrade
|
||||
# requires RouterOS, version=7.13
|
||||
# provides: capsman-rolling-upgrade.wifi
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# upgrade CAPs one after another
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/capsman-rolling-upgrade.md
|
||||
# https://rsc.eworm.de/doc/capsman-rolling-upgrade.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -22,6 +23,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -44,4 +46,6 @@
|
|||
:delay ($Delay . "s");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: certificate-renew-issued
|
||||
# Copyright (c) 2019-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2019-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# renew locally issued certificates
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/certificate-renew-issued.md
|
||||
# https://rsc.eworm.de/doc/certificate-renew-issued.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -45,4 +47,6 @@
|
|||
$LogPrint info $ScriptName ("Issued a new certificate for '" . $CertVal->"common-name" . "'.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
|
||||
# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
|
||||
# Label: "Baltimore CyberTrust Root"
|
||||
# Serial: 33554617
|
||||
# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4
|
||||
# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74
|
||||
# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
|
||||
RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
|
||||
VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
|
||||
DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
|
||||
ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
|
||||
VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
|
||||
mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
|
||||
IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
|
||||
mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
|
||||
XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy
|
||||
dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye
|
||||
jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1
|
||||
BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3
|
||||
DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92
|
||||
9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx
|
||||
jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0
|
||||
Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz
|
||||
ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS
|
||||
R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
|
||||
-----END CERTIFICATE-----
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
|
||||
# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
|
||||
# Label: "DigiCert Global Root CA"
|
||||
# Serial: 10944719598952040374951832963794454346
|
||||
# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e
|
||||
# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36
|
||||
# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
|
||||
MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
|
||||
d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
|
||||
QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
|
||||
MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
|
||||
b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
|
||||
9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
|
||||
CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
|
||||
nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
|
||||
43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
|
||||
T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
|
||||
gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
|
||||
BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
|
||||
TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
|
||||
DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
|
||||
hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
|
||||
06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
|
||||
PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
|
||||
YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
|
||||
CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
|
||||
-----END CERTIFICATE-----
|
||||
22
certs/DigiCert-Global-Root-G3.pem
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Issuer: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
|
||||
# Subject: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
|
||||
# Label: "DigiCert Global Root G3"
|
||||
# Serial: 7089244469030293291760083333884364146
|
||||
# MD5 Fingerprint: f5:5d:a4:50:a5:fb:28:7e:1e:0f:0d:cc:96:57:56:ca
|
||||
# SHA1 Fingerprint: 7e:04:de:89:6a:3e:66:6d:00:e6:87:d3:3f:fa:d9:3b:e8:3d:34:9e
|
||||
# SHA256 Fingerprint: 31:ad:66:48:f8:10:41:38:c7:38:f3:9e:a4:32:01:33:39:3e:3a:18:cc:02:29:6e:f9:7c:2a:c9:ef:67:31:d0
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw
|
||||
CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
|
||||
ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe
|
||||
Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw
|
||||
EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x
|
||||
IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF
|
||||
K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG
|
||||
fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO
|
||||
Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd
|
||||
BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx
|
||||
AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/
|
||||
oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8
|
||||
sycX
|
||||
-----END CERTIFICATE-----
|
||||
20
certs/GTS-Root-R4.pem
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
# Issuer: CN=GTS Root R4 O=Google Trust Services LLC
|
||||
# Subject: CN=GTS Root R4 O=Google Trust Services LLC
|
||||
# Label: "GTS Root R4"
|
||||
# Serial: 159662532700760215368942768210
|
||||
# MD5 Fingerprint: 43:96:83:77:19:4d:76:b3:9d:65:52:e4:1d:22:a5:e8
|
||||
# SHA1 Fingerprint: 77:d3:03:67:b5:e0:0c:15:f6:0c:38:61:df:7c:e1:3b:92:46:4d:47
|
||||
# SHA256 Fingerprint: 34:9d:fa:40:58:c5:e2:63:12:3b:39:8a:e7:95:57:3c:4e:13:13:c8:3f:e6:8f:93:55:6c:d5:e8:03:1b:3c:7d
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICCTCCAY6gAwIBAgINAgPlwGjvYxqccpBQUjAKBggqhkjOPQQDAzBHMQswCQYD
|
||||
VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIG
|
||||
A1UEAxMLR1RTIFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAw
|
||||
WjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2Vz
|
||||
IExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQAIgNi
|
||||
AATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzuhXyi
|
||||
QHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvR
|
||||
HYqjQjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
|
||||
BBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNpADBmAjEA6ED/g94D
|
||||
9J+uHXqnLrmvT/aDHQ4thQEd0dlq7A/Cr8deVl5c1RxYIigL9zC2L7F8AjEA8GE8
|
||||
p/SgguMh1YQdc4acLa/KNJvxn7kjNuK8YAOdgLOaVsjh4rsUecrNIdSUtUlD
|
||||
-----END CERTIFICATE-----
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
|
||||
# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
|
||||
# Label: "GlobalSign Root CA - R3"
|
||||
# Serial: 4835703278459759426209954
|
||||
# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28
|
||||
# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad
|
||||
# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
|
||||
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
|
||||
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
|
||||
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
|
||||
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
|
||||
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
|
||||
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
|
||||
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
|
||||
KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
|
||||
QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
|
||||
XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
|
||||
DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
|
||||
LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
|
||||
RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
|
||||
jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
|
||||
6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
|
||||
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
|
||||
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
|
||||
WD9f
|
||||
-----END CERTIFICATE-----
|
||||
58
certs/Makefile
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# Makefile to check certificates
|
||||
|
||||
CURL = curl \
|
||||
--capath /dev/null \
|
||||
--connect-timeout 5 \
|
||||
--output /dev/null \
|
||||
--silent
|
||||
|
||||
DOMAINS_DUAL = \
|
||||
api.macvendors.com/GTS-Root-R4 \
|
||||
api.telegram.org/Go-Daddy-Root-Certificate-Authority-G2 \
|
||||
cloudflare-dns.com/DigiCert-Global-Root-G2 \
|
||||
dns.google/GTS-Root-R4 \
|
||||
dns.quad9.net/DigiCert-Global-Root-G3 \
|
||||
git.eworm.de/ISRG-Root-X2 \
|
||||
lists.blocklist.de/Certum-Trusted-Network-CA \
|
||||
matrix.org/GTS-Root-R4 \
|
||||
raw.githubusercontent.com/USERTrust-RSA-Certification-Authority \
|
||||
rsc.eworm.de/ISRG-Root-X2 \
|
||||
upgrade.mikrotik.com/ISRG-Root-X1
|
||||
DOMAINS_IPV4 = \
|
||||
1.1.1.1/DigiCert-Global-Root-G2 \
|
||||
8.8.8.8/GTS-Root-R1 \
|
||||
9.9.9.9/DigiCert-Global-Root-G3 \
|
||||
api.mullvad.net/ISRG-Root-X1 \
|
||||
ipv4.showipv6.de/ISRG-Root-X1 \
|
||||
ipv4.tunnelbroker.net/Starfield-Root-Certificate-Authority-G2 \
|
||||
mkcert.org/ISRG-Root-X1 \
|
||||
ntfy.sh/ISRG-Root-X1 \
|
||||
www.dshield.org/ISRG-Root-X1 \
|
||||
www.spamhaus.org/GTS-Root-R4
|
||||
DOMAINS_IPV6 = \
|
||||
[2606\:4700\:4700\:\:1111]/DigiCert-Global-Root-G2 \
|
||||
[2001\:4860\:4860\:\:8888]/GTS-Root-R1 \
|
||||
[2620\:fe\:\:9]/DigiCert-Global-Root-G3 \
|
||||
ipv6.showipv6.de/ISRG-Root-X1
|
||||
|
||||
.PHONY: $(DOMAINS_DUAL) $(DOMAINS_IPV4) $(DOMAINS_IPV6)
|
||||
|
||||
all: $(DOMAINS_DUAL) $(DOMAINS_IPV4) $(DOMAINS_IPV6)
|
||||
|
||||
$(DOMAINS_DUAL):
|
||||
ifndef NOIPV4
|
||||
$(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@)
|
||||
endif
|
||||
ifndef NOIPV6
|
||||
$(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@)
|
||||
endif
|
||||
|
||||
$(DOMAINS_IPV4):
|
||||
ifndef NOIPV4
|
||||
$(CURL) -4 --cacert $(notdir $@).pem https://$(dir $@)
|
||||
endif
|
||||
|
||||
$(DOMAINS_IPV6):
|
||||
ifndef NOIPV6
|
||||
$(CURL) -6 --cacert $(notdir $@).pem https://$(dir $@)
|
||||
endif
|
||||
41
certs/USERTrust-RSA-Certification-Authority.pem
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
|
||||
# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
|
||||
# Label: "USERTrust RSA Certification Authority"
|
||||
# Serial: 2645093764781058787591871645665788717
|
||||
# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5
|
||||
# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e
|
||||
# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
|
||||
iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
|
||||
cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
|
||||
BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw
|
||||
MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV
|
||||
BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU
|
||||
aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy
|
||||
dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
|
||||
AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B
|
||||
3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY
|
||||
tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/
|
||||
Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2
|
||||
VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT
|
||||
79uq/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6
|
||||
c0Plfg6lZrEpfDKEY1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmT
|
||||
Yo61Zs8liM2EuLE/pDkP2QKe6xJMlXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97l
|
||||
c6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8yexDJtC/QV9AqURE9JnnV4ee
|
||||
UB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+eLf8ZxXhyVeE
|
||||
Hg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd
|
||||
BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G
|
||||
A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF
|
||||
Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO
|
||||
VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3
|
||||
ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs
|
||||
8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR
|
||||
iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze
|
||||
Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ
|
||||
XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
|
||||
qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
|
||||
VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
|
||||
L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
|
||||
jjxDah2nGN59PRbxYvnKkKj9
|
||||
-----END CERTIFICATE-----
|
||||
|
|
@ -1,16 +1,18 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-certificates
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
# requires device-mode, fetch
|
||||
#
|
||||
# check for certificate validity
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-certificates.md
|
||||
# https://rsc.eworm.de/doc/check-certificates.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -32,7 +34,8 @@
|
|||
|
||||
:local CheckCertificatesDownloadImport do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
:local Name [ :tostr $2 ];
|
||||
:local CertName [ :tostr $2 ];
|
||||
:local FetchName [ :tostr $3 ];
|
||||
|
||||
:global CertRenewUrl;
|
||||
:global CertRenewPass;
|
||||
|
|
@ -41,43 +44,51 @@
|
|||
:global EscapeForRegEx;
|
||||
:global FetchUserAgentStr;
|
||||
:global LogPrint;
|
||||
:global RmFile;
|
||||
:global UrlEncode;
|
||||
:global WaitForFile;
|
||||
|
||||
:local Return false;
|
||||
:foreach Type in={ "p12"; "pem" } do={
|
||||
:local CertFileName ([ $UrlEncode $FetchName ] . "." . $Type);
|
||||
$LogPrint debug $ScriptName ("Trying type '" . $Type . "' for '" . $CertName . \
|
||||
"' (file '" . $CertFileName . "')...");
|
||||
|
||||
:foreach Type in={ ".pem"; ".p12" } do={
|
||||
:local CertFileName ([ $UrlEncode $Name ] . $Type);
|
||||
:do {
|
||||
/tool/fetch check-certificate=yes-without-crl http-header-field=({ [ $FetchUserAgentStr $ScriptName ] }) \
|
||||
($CertRenewUrl . $CertFileName) dst-path=$CertFileName as-value;
|
||||
$WaitForFile $CertFileName;
|
||||
|
||||
:local DecryptionFailed true;
|
||||
:foreach PassPhrase in=$CertRenewPass do={
|
||||
:local Result [ /certificate/import file-name=$CertFileName passphrase=$PassPhrase as-value ];
|
||||
:if ($Result->"decryption-failures" = 0) do={
|
||||
:set DecryptionFailed false;
|
||||
}
|
||||
:foreach I,PassPhrase in=$CertRenewPass do={
|
||||
:do {
|
||||
$LogPrint debug $ScriptName ("Trying " . $I . ". passphrase... ");
|
||||
:local Result [ /certificate/import file-name=$CertFileName passphrase=$PassPhrase as-value ];
|
||||
:if ($Result->"decryption-failures" = 0) do={
|
||||
$LogPrint debug $ScriptName ("Success!");
|
||||
:set DecryptionFailed false;
|
||||
}
|
||||
} on-error={ }
|
||||
}
|
||||
/file/remove [ find where name=$CertFileName ];
|
||||
$RmFile $CertFileName;
|
||||
|
||||
:if ($DecryptionFailed = true) do={
|
||||
$LogPrint warning $ScriptName ("Decryption failed for certificate file '" . $CertFileName . "'.");
|
||||
}
|
||||
|
||||
:foreach CertInChain in=[ /certificate/find where name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \
|
||||
common-name!=$Name !(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $Name ] . "(\\W|\$)")) !(common-name=[]) ] do={
|
||||
:foreach CertInChain in=[ /certificate/find where common-name!=$CertName !private-key \
|
||||
name~("^" . [ $EscapeForRegEx $CertFileName ] . "_[0-9]+\$") \
|
||||
!(subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $CertName ] . "(\\W|\$)")) \
|
||||
!(common-name=[]) ] do={
|
||||
$CertificateNameByCN [ /certificate/get $CertInChain common-name ];
|
||||
}
|
||||
|
||||
:set Return true;
|
||||
:return true;
|
||||
} on-error={
|
||||
$LogPrint debug $ScriptName ("Could not download certificate file '" . $CertFileName . "'.");
|
||||
}
|
||||
}
|
||||
|
||||
:return $Return;
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local FormatInfo do={
|
||||
|
|
@ -133,14 +144,15 @@
|
|||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
||||
:foreach Cert in=[ /certificate/find where !revoked !ca !scep-url expires-after<$CertRenewTime ] do={
|
||||
:local CertVal [ /certificate/get $Cert ];
|
||||
:local CertNew;
|
||||
:local LastName;
|
||||
:local FetchName;
|
||||
|
||||
:do {
|
||||
:if ([ :len $CertRenewUrl ] = 0) do={
|
||||
|
|
@ -151,11 +163,17 @@
|
|||
|
||||
:local ImportSuccess false;
|
||||
:set LastName ($CertVal->"common-name");
|
||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ];
|
||||
:set FetchName $LastName;
|
||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ];
|
||||
:foreach SAN in=($CertVal->"subject-alt-name") do={
|
||||
:if ($ImportSuccess = false) do={
|
||||
:set LastName [ :pick $SAN ([ :find $SAN ":" ] + 1) [ :len $SAN ] ];
|
||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName ];
|
||||
:set FetchName $LastName;
|
||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ];
|
||||
:if ($ImportSuccess = false && [ :pick $LastName 0 2 ] = "*.") do={
|
||||
:set FetchName ("star." . [ :pick $LastName 2 [ :len $LastName ] ]);
|
||||
:set ImportSuccess [ $CheckCertificatesDownloadImport $ScriptName $LastName $FetchName ];
|
||||
}
|
||||
}
|
||||
}
|
||||
:if ($ImportSuccess = false) do={ :error false; }
|
||||
|
|
@ -166,7 +184,7 @@
|
|||
} else={
|
||||
$LogPrint debug $ScriptName ("Certificate '" . $CertVal->"name" . "' was not updated, but replaced.");
|
||||
|
||||
:set CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ $UrlEncode $LastName ] ] . "\\.(p12|pem)_[0-9]+\$") \
|
||||
:local CertNew [ /certificate/find where name~("^" . [ $EscapeForRegEx [ $UrlEncode $FetchName ] ] . "\\.(p12|pem)_[0-9]+\$") \
|
||||
(common-name=($CertVal->"common-name") or subject-alt-name~("(^|\\W)(DNS|IP):" . [ $EscapeForRegEx $LastName ] . "(\\W|\$)")) \
|
||||
fingerprint!=[ :tostr ($CertVal->"fingerprint") ] expires-after>$CertRenewTime ];
|
||||
:local CertNewVal [ /certificate/get $CertNew ];
|
||||
|
|
@ -190,13 +208,13 @@
|
|||
|
||||
/certificate/remove $Cert;
|
||||
/certificate/set $CertNew name=($CertVal->"name");
|
||||
:set CertNewVal;
|
||||
:set Cert $CertNew;
|
||||
:set CertVal [ /certificate/get $CertNew ];
|
||||
}
|
||||
|
||||
$SendNotification2 ({ origin=$ScriptName; silent=true; \
|
||||
subject=([ $SymbolForNotification "lock-with-ink-pen" ] . "Certificate renewed: " . ($CertVal->"name")); \
|
||||
message=("A certificate on " . $Identity . " has been renewed.\n\n" . [ $FormatInfo $CertNew ]) });
|
||||
message=("A certificate on " . $Identity . " has been renewed.\n\n" . [ $FormatInfo $Cert ]) });
|
||||
$LogPrint info $ScriptName ("The certificate '" . ($CertVal->"name") . "' has been renewed.");
|
||||
} on-error={
|
||||
$LogPrint debug $ScriptName ("Could not renew certificate '" . ($CertVal->"name") . "'.");
|
||||
|
|
@ -219,4 +237,6 @@
|
|||
", it is invalid after " . ($CertVal->"invalid-after") . ".");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
48
check-health.d/state.rsc
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-health.d/state
|
||||
# Copyright (c) 2019-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# check for RouterOS health state - state plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:global CheckHealthPlugins;
|
||||
|
||||
:set ($CheckHealthPlugins->[ :jobname ]) do={
|
||||
:local FuncName [ :tostr $0 ];
|
||||
|
||||
:global CheckHealthLast;
|
||||
:global Identity;
|
||||
|
||||
:global LogPrint;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
:if ([ :len [ /system/health/find where type="" name~"-state\$"] ] = 0) do={
|
||||
$LogPrint debug $FuncName ("Your device does not provide any state health values.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach State in=[ /system/health/find where type="" name~"-state\$" ] do={
|
||||
:local Name [ /system/health/get $State name ];
|
||||
:local Value [ /system/health/get $State value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:if ($CheckHealthLast->$Name = "ok" && \
|
||||
$Value != "ok") do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "cross-mark" ] . "Health warning: " . $Name); \
|
||||
message=("The device '" . $Name . "' on " . $Identity . " failed!") });
|
||||
}
|
||||
:if ($CheckHealthLast->$Name != "ok" && \
|
||||
$Value = "ok") do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
||||
message=("The device '" . $Name . "' on " . $Identity . " recovered!") });
|
||||
}
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
}
|
||||
}
|
||||
74
check-health.d/temperature.rsc
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-health.d/temperature
|
||||
# Copyright (c) 2019-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# check for RouterOS health state - temperature plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:global CheckHealthPlugins;
|
||||
|
||||
:set ($CheckHealthPlugins->[ :jobname ]) do={
|
||||
:local FuncName [ :tostr $0 ];
|
||||
|
||||
:global CheckHealthLast;
|
||||
:global CheckHealthTemperature;
|
||||
:global CheckHealthTemperatureDeviation;
|
||||
:global CheckHealthTemperatureNotified;
|
||||
:global Identity;
|
||||
|
||||
:global LogPrint;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
:if ([ :len [ /system/health/find where type="C" ] ] = 0) do={
|
||||
$LogPrint debug $FuncName ("Your device does not provide any voltage health values.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:local TempToNum do={
|
||||
:global CharacterReplace;
|
||||
:local T [ :toarray [ $CharacterReplace $1 "." "," ] ];
|
||||
:return ($T->0 * 10 + $T->1);
|
||||
}
|
||||
|
||||
:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={
|
||||
:set CheckHealthTemperatureNotified ({});
|
||||
}
|
||||
|
||||
:foreach Temperature in=[ /system/health/find where type="C" ] do={
|
||||
:local Name [ /system/health/get $Temperature name ];
|
||||
:local Value [ /system/health/get $Temperature value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:if ([ :typeof ($CheckHealthTemperature->$Name) ] != "num" ) do={
|
||||
$LogPrint info $FuncName ("No threshold given for " . $Name . ", assuming 50C.");
|
||||
:set ($CheckHealthTemperature->$Name) 50;
|
||||
}
|
||||
:local Validate [ /system/health/get [ find where name=$Name ] value ];
|
||||
:while ($Value != $Validate) do={
|
||||
:set Value $Validate;
|
||||
:set Validate [ /system/health/get [ find where name=$Name ] value ];
|
||||
}
|
||||
:if ($Value > $CheckHealthTemperature->$Name && \
|
||||
$CheckHealthTemperatureNotified->$Name != true) do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " is above threshold: " . \
|
||||
$Value . "\C2\B0" . "C") });
|
||||
:set ($CheckHealthTemperatureNotified->$Name) true;
|
||||
}
|
||||
:if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \
|
||||
$CheckHealthTemperatureNotified->$Name = true) do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \
|
||||
$Value . "\C2\B0" . "C") });
|
||||
:set ($CheckHealthTemperatureNotified->$Name) false;
|
||||
}
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
}
|
||||
}
|
||||
63
check-health.d/voltage.rsc
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-health.d/voltage
|
||||
# Copyright (c) 2019-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# check for RouterOS health state - voltage plugin
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:global CheckHealthPlugins;
|
||||
|
||||
:set ($CheckHealthPlugins->[ :jobname ]) do={
|
||||
:local FuncName [ :tostr $0 ];
|
||||
|
||||
:global CheckHealthLast;
|
||||
:global CheckHealthVoltageLow;
|
||||
:global CheckHealthVoltagePercent;
|
||||
:global Identity;
|
||||
|
||||
:global FormatLine;
|
||||
:global IfThenElse;
|
||||
:global LogPrint;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
||||
:if ([ :len [ /system/health/find where type="V" ] ] = 0) do={
|
||||
$LogPrint debug $FuncName ("Your device does not provide any voltage health values.");
|
||||
:return false;
|
||||
}
|
||||
|
||||
:foreach Voltage in=[ /system/health/find where type="V" ] do={
|
||||
:local Name [ /system/health/get $Voltage name ];
|
||||
:local Value [ /system/health/get $Voltage value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:local NumCurr [ $TempToNum $Value ];
|
||||
:local NumLast [ $TempToNum ($CheckHealthLast->$Name) ];
|
||||
|
||||
:if ($NumLast * (100 + $CheckHealthVoltagePercent) < $NumCurr * 100 || \
|
||||
$NumLast * 100 > $NumCurr * (100 + $CheckHealthVoltagePercent)) do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \
|
||||
$NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \
|
||||
[ $FormatLine "old value" ($CheckHealthLast->$Name . " V") 12 ] . "\n" . \
|
||||
[ $FormatLine "new value" ($Value . " V") 12 ]) });
|
||||
} else={
|
||||
:if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") });
|
||||
}
|
||||
:if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$FuncName; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") });
|
||||
}
|
||||
}
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
}
|
||||
}
|
||||
124
check-health.rsc
|
|
@ -1,16 +1,17 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-health
|
||||
# Copyright (c) 2019-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2019-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# check for RouterOS health state
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-health.md
|
||||
# https://rsc.eworm.de/doc/check-health.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -18,11 +19,6 @@
|
|||
:global CheckHealthCPUUtilizationNotified;
|
||||
:global CheckHealthLast;
|
||||
:global CheckHealthRAMUtilizationNotified;
|
||||
:global CheckHealthTemperature;
|
||||
:global CheckHealthTemperatureDeviation;
|
||||
:global CheckHealthTemperatureNotified;
|
||||
:global CheckHealthVoltageLow;
|
||||
:global CheckHealthVoltagePercent;
|
||||
:global Identity;
|
||||
|
||||
:global FormatLine;
|
||||
|
|
@ -32,6 +28,7 @@
|
|||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
:global ValidateSyntax;
|
||||
|
||||
:local TempToNum do={
|
||||
:global CharacterReplace;
|
||||
|
|
@ -40,6 +37,7 @@
|
|||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -76,103 +74,37 @@
|
|||
:set CheckHealthRAMUtilizationNotified false;
|
||||
}
|
||||
|
||||
:if ([ :len [ /system/health/find ] ] = 0) do={
|
||||
$LogPrint debug $ScriptName ("Your device does not provide any health values.");
|
||||
: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;
|
||||
}
|
||||
|
||||
:global CheckHealthPlugins ({});
|
||||
:if ([ :typeof $CheckHealthLast ] != "array") do={
|
||||
:set CheckHealthLast ({});
|
||||
}
|
||||
:if ([ :typeof $CheckHealthTemperatureNotified ] != "array") do={
|
||||
:set CheckHealthTemperatureNotified ({});
|
||||
}
|
||||
|
||||
|
||||
:foreach Voltage in=[ /system/health/find where type="V" ] do={
|
||||
:local Name [ /system/health/get $Voltage name ];
|
||||
:local Value [ /system/health/get $Voltage value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:local NumCurr [ $TempToNum $Value ];
|
||||
:local NumLast [ $TempToNum ($CheckHealthLast->$Name) ];
|
||||
|
||||
:if ($NumLast * (100 + $CheckHealthVoltagePercent) < $NumCurr * 100 || \
|
||||
$NumLast * 100 > $NumCurr * (100 + $CheckHealthVoltagePercent)) do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification ("high-voltage-sign,chart-" . [ $IfThenElse ($NumLast < \
|
||||
$NumCurr) "in" "de" ] . "creasing") ] . "Health warning: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " jumped more than " . $CheckHealthVoltagePercent . "%.\n\n" . \
|
||||
[ $FormatLine "old value" ($CheckHealthLast->$Name . " V") 12 ] . "\n" . \
|
||||
[ $FormatLine "new value" ($Value . " V") 12 ]) });
|
||||
} else={
|
||||
:if ($NumCurr <= $CheckHealthVoltageLow && $NumLast > $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-decreasing" ] . "Health warning: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " dropped to " . $Value . " V below hard limit.") });
|
||||
}
|
||||
:if ($NumCurr > $CheckHealthVoltageLow && $NumLast <= $CheckHealthVoltageLow) do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "high-voltage-sign,chart-increasing" ] . "Health recovery: Low " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " recovered to " . $Value . " V above hard limit.") });
|
||||
}
|
||||
:foreach Plugin in=$Plugins do={
|
||||
:local PluginVal [ /system/script/get $Plugin ];
|
||||
:if ([ $ValidateSyntax ($PluginVal->"source") ] = true) do={
|
||||
:do {
|
||||
/system/script/run $Plugin;
|
||||
} on-error={
|
||||
$LogPrint error $ScriptName ("Plugin '" . $ScriptVal->"name" . "' failed to run.");
|
||||
}
|
||||
} else={
|
||||
$LogPrint error $ScriptName ("Plugin '" . $ScriptVal->"name" . "' failed syntax validation, skipping.");
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
}
|
||||
|
||||
:foreach PSU in=[ /system/health/find where name~"^psu.*-state\$" ] do={
|
||||
:local Name [ /system/health/get $PSU name ];
|
||||
:local Value [ /system/health/get $PSU value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:if ($CheckHealthLast->$Name = "ok" && \
|
||||
$Value != "ok") do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "cross-mark" ] . "Health warning: " . $Name); \
|
||||
message=("The power supply unit '" . $Name . "' on " . $Identity . " failed!") });
|
||||
}
|
||||
:if ($CheckHealthLast->$Name != "ok" && \
|
||||
$Value = "ok") do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
||||
message=("The power supply unit '" . $Name . "' on " . $Identity . " recovered!") });
|
||||
}
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
:foreach PluginName,Discard in=$CheckHealthPlugins do={
|
||||
($CheckHealthPlugins->$PluginName) \
|
||||
("\$CheckHealthPlugins->\"" . $PluginName . "\"");
|
||||
}
|
||||
|
||||
:foreach Temperature in=[ /system/health/find where type="C" ] do={
|
||||
:local Name [ /system/health/get $Temperature name ];
|
||||
:local Value [ /system/health/get $Temperature value ];
|
||||
|
||||
:if ([ :typeof ($CheckHealthLast->$Name) ] != "nothing") do={
|
||||
:if ([ :typeof ($CheckHealthTemperature->$Name) ] != "num" ) do={
|
||||
$LogPrint info $ScriptName ("No threshold given for " . $Name . ", assuming 50C.");
|
||||
:set ($CheckHealthTemperature->$Name) 50;
|
||||
}
|
||||
:local Validate [ /system/health/get [ find where name=$Name ] value ];
|
||||
:while ($Value != $Validate) do={
|
||||
:set Value $Validate;
|
||||
:set Validate [ /system/health/get [ find where name=$Name ] value ];
|
||||
}
|
||||
:if ($Value > $CheckHealthTemperature->$Name && \
|
||||
$CheckHealthTemperatureNotified->$Name != true) do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "fire" ] . "Health warning: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " is above threshold: " . \
|
||||
$Value . "\C2\B0" . "C") });
|
||||
:set ($CheckHealthTemperatureNotified->$Name) true;
|
||||
}
|
||||
:if ($Value <= ($CheckHealthTemperature->$Name - $CheckHealthTemperatureDeviation) && \
|
||||
$CheckHealthTemperatureNotified->$Name = true) do={
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Health recovery: " . $Name); \
|
||||
message=("The " . $Name . " on " . $Identity . " dropped below threshold: " . \
|
||||
$Value . "\C2\B0" . "C") });
|
||||
:set ($CheckHealthTemperatureNotified->$Name) false;
|
||||
}
|
||||
}
|
||||
:set ($CheckHealthLast->$Name) $Value;
|
||||
}
|
||||
} on-error={ }
|
||||
:set CheckHealthPlugins;
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-lte-firmware-upgrade
|
||||
# Copyright (c) 2018-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2018-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# check for LTE firmware upgrade, send notification
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-lte-firmware-upgrade.md
|
||||
# https://rsc.eworm.de/doc/check-lte-firmware-upgrade.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -19,6 +20,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -100,4 +102,6 @@
|
|||
:foreach Interface in=[ /interface/lte/find ] do={
|
||||
$CheckInterface $ScriptName $Interface;
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: check-routeros-update
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
# requires device-mode, fetch, scheduler
|
||||
#
|
||||
# check for RouterOS update, send notification and/or install
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/check-routeros-update.md
|
||||
# https://rsc.eworm.de/doc/check-routeros-update.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -34,38 +36,85 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:local DoUpdate do={
|
||||
:local ScriptName [ :tostr $1 ];
|
||||
|
||||
:global LogPrint;
|
||||
|
||||
:if ([ :len [ /system/script/find where name="packages-update" ] ] > 0) do={
|
||||
/system/script/run packages-update;
|
||||
} else={
|
||||
/system/package/update/install without-paging;
|
||||
}
|
||||
:error "Waiting for system to reboot.";
|
||||
$LogPrint info $ScriptName ("Waiting for system to reboot.");
|
||||
}
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
: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;
|
||||
}
|
||||
|
||||
$WaitFullyConnected;
|
||||
|
||||
:if ([ :len [ /system/scheduler/find where name="_RebootForUpdate" ] ] > 0) do={
|
||||
:set ExitOK true;
|
||||
:error "A reboot for update is already scheduled.";
|
||||
}
|
||||
|
||||
:local License [ /system/license/get ];
|
||||
:if ([ :typeof ($License->"deadline-at") ] = "str") do={
|
||||
:if ([ :len ($License->"next-renewal-at") ] = 0 && ($License->"limited-upgrades") = true) do={
|
||||
$LogPrint warning $ScriptName ("Your license expired on " . ($License->"deadline-at") . "!");
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "warning-sign" ] . "License expired!"); \
|
||||
message=("Your license expired on " . ($License->"deadline-at") . \
|
||||
", can no longer update RouterOS on " . $Identity . "...") });
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:if ([ :totime ($License->"deadline-at") ] - 3w < [ :timestamp ]) do={
|
||||
$LogPrint warning $ScriptName ("Your license will expire on " . ($License->"deadline-at") . "!");
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "warning-sign" ] . "License about to expire!"); \
|
||||
message=("Your license failed to renew and is about to expire on " . \
|
||||
($License->"deadline-at") . " on " . $Identity . "...") });
|
||||
}
|
||||
}
|
||||
|
||||
$LogPrint debug $ScriptName ("Checking for updates...");
|
||||
/system/package/update/check-for-updates without-paging as-value;
|
||||
:local Update [ /system/package/update/get ];
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true && ($Update->"installed-version") = ($Update->"latest-version")) do={
|
||||
$LogPrint info $ScriptName ("System is already up to date.");
|
||||
:if (($Update->"installed-version") = ($Update->"latest-version")) do={
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
|
||||
$LogPrint info $ScriptName ("System is already up to date.");
|
||||
}
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
}
|
||||
|
||||
:if ([ :len ($Update->"latest-version") ] = 0) do={
|
||||
$LogPrint info $ScriptName ("Received an empty version string from server.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
:local NumInstalled [ $VersionToNum ($Update->"installed-version") ];
|
||||
:local NumLatest [ $VersionToNum ($Update->"latest-version") ];
|
||||
:local BitMask [ $VersionToNum "255.255zero0" ];
|
||||
:local NumInstalledFeature ($NumInstalled & $BitMask);
|
||||
:local NumLatestFeature ($NumLatest & $BitMask);
|
||||
:local Link ("https://mikrotik.com/download/changelogs/" . $Update->"channel" . "-release-tree");
|
||||
|
||||
:if ($NumLatest < 117505792) do={
|
||||
$LogPrint info $ScriptName ("The version '" . ($Update->"latest-version") . "' is not a valid version.");
|
||||
:if ($NumLatest < [ $VersionToNum "7.0" ]) do={
|
||||
$LogPrint warning $ScriptName ("The version '" . ($Update->"latest-version") . "' is not a valid version.");
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -77,16 +126,20 @@
|
|||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||
message=("Installing ALL versions automatically, including " . $Update->"latest-version" . \
|
||||
"... Updating on " . $Identity . "..."); link=$Link; silent=true });
|
||||
$DoUpdate;
|
||||
$DoUpdate $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
}
|
||||
|
||||
:if ($SafeUpdatePatch = true && ($NumInstalled & 0xffff0000) = ($NumLatest & 0xffff0000)) do={
|
||||
:if ($SafeUpdatePatch = true && $NumInstalledFeature = $NumLatestFeature) do={
|
||||
$LogPrint info $ScriptName ("Version " . $Update->"latest-version" . " is a patch release, updating...");
|
||||
$SendNotification2 ({ origin=$ScriptName; \
|
||||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||
message=("Version " . $Update->"latest-version" . " is a patch update for " . $Update->"channel" . \
|
||||
", updating on " . $Identity . "..."); link=$Link; silent=true });
|
||||
$DoUpdate;
|
||||
$DoUpdate $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
}
|
||||
|
||||
:if ($SafeUpdateNeighbor = true) do={
|
||||
|
|
@ -100,7 +153,9 @@
|
|||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||
message=("Seen a neighbor (" . $Neighbor . ") running version " . $Update->"latest-version" . \
|
||||
" from " . $Update->"channel" . ", updating on " . $Identity . "..."); link=$Link; silent=true });
|
||||
$DoUpdate;
|
||||
$DoUpdate $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -120,14 +175,28 @@
|
|||
subject=([ $SymbolForNotification "sparkles" ] . "RouterOS update: " . $Update->"latest-version"); \
|
||||
message=("Version " . $Update->"latest-version" . " is considered safe for " . $Update->"channel" . \
|
||||
", updating on " . $Identity . "..."); link=$Link; silent=true });
|
||||
$DoUpdate;
|
||||
$DoUpdate $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
}
|
||||
}
|
||||
|
||||
:if ([ $ScriptFromTerminal $ScriptName ] = true) do={
|
||||
:if (($Update->"channel") = "testing" && $NumInstalledFeature < $NumLatestFeature) do={
|
||||
:put ("This is a feature update in testing channel. Switch to channel 'stable'? [y/N]");
|
||||
: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;
|
||||
}
|
||||
}
|
||||
|
||||
:put ("Do you want to install RouterOS version " . $Update->"latest-version" . "? [y/N]");
|
||||
:if (([ /terminal/inkey timeout=60 ] % 32) = 25) do={
|
||||
$DoUpdate;
|
||||
$DoUpdate $ScriptName;
|
||||
:set ExitOK true;
|
||||
:error true;
|
||||
} else={
|
||||
:put "Canceled...";
|
||||
}
|
||||
|
|
@ -136,6 +205,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;
|
||||
}
|
||||
|
||||
|
|
@ -151,6 +221,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;
|
||||
}
|
||||
|
||||
|
|
@ -163,4 +234,6 @@
|
|||
" is available for downgrade.");
|
||||
:set SentRouterosUpdateNotification ($Update->"latest-version");
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: collect-wireless-mac.capsman
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# collect wireless mac adresses in access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
|
||||
# https://rsc.eworm.de/doc/collect-wireless-mac.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
:global SymbolForNotification;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -93,4 +95,6 @@
|
|||
$LogPrint debug $ScriptName ("No mac address available... Ignoring.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: collect-wireless-mac.local
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# collect wireless mac adresses in access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
|
||||
# https://rsc.eworm.de/doc/collect-wireless-mac.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
:global SymbolForNotification;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -94,4 +96,6 @@
|
|||
$LogPrint debug $ScriptName ("No mac address available... Ignoring.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: collect-wireless-mac%TEMPL%
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# collect wireless mac adresses in access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
|
||||
# https://rsc.eworm.de/doc/collect-wireless-mac.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
:global SymbolForNotification;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -111,4 +113,6 @@
|
|||
$LogPrint debug $ScriptName ("No mac address available... Ignoring.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: collect-wireless-mac.wifi
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=40
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# collect wireless mac adresses in access list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/collect-wireless-mac.md
|
||||
# https://rsc.eworm.de/doc/collect-wireless-mac.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
:global SymbolForNotification;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -93,4 +95,6 @@
|
|||
$LogPrint debug $ScriptName ("No mac address available... Ignoring.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: daily-psk.capsman
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update daily PSK (pre shared key)
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md
|
||||
# https://rsc.eworm.de/doc/daily-psk.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -23,7 +24,6 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrint;
|
||||
:global RequiredRouterOS;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -90,4 +91,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: daily-psk.local
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update daily PSK (pre shared key)
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md
|
||||
# https://rsc.eworm.de/doc/daily-psk.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -23,7 +24,6 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrint;
|
||||
:global RequiredRouterOS;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -89,4 +90,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: daily-psk%TEMPL%
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update daily PSK (pre shared key)
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md
|
||||
# https://rsc.eworm.de/doc/daily-psk.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -24,7 +25,6 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrint;
|
||||
:global RequiredRouterOS;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
|
@ -33,6 +33,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -86,7 +87,7 @@
|
|||
/interface/wireless/access-list/set $AccList private-pre-shared-key=$NewPsk;
|
||||
|
||||
:if ([ :len [ /caps-man/actual-interface-configuration/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={
|
||||
:if ([ $RequiredRouterOS $ScriptName "7.15beta8" false ] = false || [ :len [ /interface/wifi/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={
|
||||
:if ([ :len [ /interface/wifi/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={
|
||||
:if ([ :len [ /interface/wireless/find where name=$IntName !disabled ] ] = 1) do={
|
||||
:if ($Seen->$Ssid = 1) do={
|
||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||
|
|
@ -105,4 +106,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: daily-psk.wifi
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# Michael Gisbers <michael@gisbers.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update daily PSK (pre shared key)
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/daily-psk.md
|
||||
# https://rsc.eworm.de/doc/daily-psk.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -23,7 +24,6 @@
|
|||
|
||||
:global FormatLine;
|
||||
:global LogPrint;
|
||||
:global RequiredRouterOS;
|
||||
:global ScriptLock;
|
||||
:global SendNotification2;
|
||||
:global SymbolForNotification;
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
:global WaitFullyConnected;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
$WaitFullyConnected;
|
||||
|
|
@ -72,7 +73,7 @@
|
|||
$LogPrint info $ScriptName ("Updating daily PSK for '" . $Ssid . "' to '" . $NewPsk . "' (was '" . $OldPsk . "')");
|
||||
/interface/wifi/access-list/set $AccList passphrase=$NewPsk;
|
||||
|
||||
:if ([ $RequiredRouterOS $ScriptName "7.15beta8" false ] = false || [ :len [ /interface/wifi/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={
|
||||
:if ([ :len [ /interface/wifi/find where configuration.ssid=$Ssid !disabled ] ] > 0) do={
|
||||
:if ($Seen->$Ssid = 1) do={
|
||||
$LogPrint debug $ScriptName ("Already sent a mail for SSID " . $Ssid . ", skipping.");
|
||||
} else={
|
||||
|
|
@ -90,4 +91,6 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: dhcp-lease-comment.capsman
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update dhcp-server lease comment with infos from access-list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
|
||||
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -36,4 +38,6 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: dhcp-lease-comment.local
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update dhcp-server lease comment with infos from access-list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
|
||||
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -36,4 +38,6 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: dhcp-lease-comment%TEMPL%
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update dhcp-server lease comment with infos from access-list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
|
||||
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
|
||||
#
|
||||
# !! This is just a template to generate the real script!
|
||||
# !! Pattern '%TEMPL%' is replaced, paths are filtered.
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -22,6 +23,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -41,4 +43,6 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: dhcp-lease-comment.wifi
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=60
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.15
|
||||
#
|
||||
# update dhcp-server lease comment with infos from access-list
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-lease-comment.md
|
||||
# https://rsc.eworm.de/doc/dhcp-lease-comment.md
|
||||
#
|
||||
# !! Do not edit this file, it is generated from template!
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -36,4 +38,6 @@
|
|||
/ip/dhcp-server/lease/set comment=$NewComment $Lease;
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: dhcp-to-dns
|
||||
# Copyright (c) 2013-2024 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/COPYING.md
|
||||
# Copyright (c) 2013-2025 Christian Hesse <mail@eworm.de>
|
||||
# https://rsc.eworm.de/COPYING.md
|
||||
#
|
||||
# provides: lease-script, order=20
|
||||
# requires RouterOS, version=7.13
|
||||
# requires RouterOS, version=7.16
|
||||
#
|
||||
# check DHCP leases and add/remove/update DNS entries
|
||||
# https://git.eworm.de/cgit/routeros-scripts/about/doc/dhcp-to-dns.md
|
||||
# https://rsc.eworm.de/doc/dhcp-to-dns.md
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
|
|
@ -27,6 +28,7 @@
|
|||
:global ScriptLock;
|
||||
|
||||
:if ([ $ScriptLock $ScriptName 10 ] = false) do={
|
||||
:set ExitOK true;
|
||||
:error false;
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +42,7 @@
|
|||
}
|
||||
:local PlaceBefore ([ /ip/dns/static/find where (name=$CommentString or (comment=$CommentString and name=-)) type=NXDOMAIN disabled ]->0);
|
||||
|
||||
:foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix . "\\b") (!type or type=A) ] do={
|
||||
:foreach DnsRecord in=[ /ip/dns/static/find where comment~("^" . $CommentPrefix . "\\b") type=A ] do={
|
||||
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
||||
:local DnsRecordInfo [ $ParseKeyValueStore ($DnsRecordVal->"comment") ];
|
||||
:local MacInServer ($DnsRecordInfo->"macaddress" . " in " . $DnsRecordInfo->"server");
|
||||
|
|
@ -83,7 +85,7 @@
|
|||
:local FullCN ($HostName . "." . $NetDomain);
|
||||
:local MacInServer ($LeaseVal->"active-mac-address" . " in " . $LeaseVal->"server");
|
||||
|
||||
:local DnsRecord [ /ip/dns/static/find where comment=$Comment (!type or type=A) ];
|
||||
:local DnsRecord [ /ip/dns/static/find where comment=$Comment type=A ];
|
||||
:if ([ :len $DnsRecord ] > 0) do={
|
||||
:local DnsRecordVal [ /ip/dns/static/get $DnsRecord ];
|
||||
|
||||
|
|
@ -116,11 +118,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
:if ([ :len [ /ip/dns/static/find where name=$FullA (!type or type=A) ] ] > 1) do={
|
||||
: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={
|
||||
$LogPrint debug $ScriptName ("No address available... Ignoring.");
|
||||
}
|
||||
}
|
||||
} on-error={ }
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
|
@ -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)
|
||||
|
||||
|
|
@ -17,22 +17,24 @@ Description
|
|||
-----------
|
||||
|
||||
This script is run from scheduler periodically, sending notification on
|
||||
health related events:
|
||||
health related events. Monitoring CPU and RAM utilization (available
|
||||
processing and memory resources) works on all devices:
|
||||
|
||||
* high CPU utilization
|
||||
* high RAM utilization (low available RAM)
|
||||
|
||||
With additional plugins functionality can be extended, depending on
|
||||
sensors available in hardware:
|
||||
|
||||
* voltage jumps up or down more than configured threshold
|
||||
* voltage drops below hard lower limit
|
||||
* fan failed or recovered
|
||||
* power supply failed or recovered
|
||||
* temperature is above or below threshold
|
||||
|
||||
Note that bad initial state will not trigger an event.
|
||||
|
||||
Monitoring CPU and RAM utilization (available processing and memory
|
||||
resources) works on all devices. Other than that only sensors available
|
||||
in hardware can be checked. See what your hardware supports:
|
||||
|
||||
/system/health/print;
|
||||
> ⚠️ **Warning**: Note that bad initial state will not trigger an event! For
|
||||
> example rebooting a device that is already too hot will not trigger an
|
||||
> alert on high temperature.
|
||||
|
||||
### Sample notifications
|
||||
|
||||
|
|
@ -57,8 +59,8 @@ in hardware can be checked. See what your hardware supports:
|
|||
|
||||
#### PSU state
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
Requirements and installation
|
||||
-----------------------------
|
||||
|
|
@ -72,6 +74,30 @@ Just install the script and create a scheduler:
|
|||
> precision of cpu utilization, escpecially on devices with limited
|
||||
> resources. Thus an unusual interval is used here.
|
||||
|
||||
### Plugins
|
||||
|
||||
Additional plugins are available for sensors available in hardware. First
|
||||
check what your hardware supports:
|
||||
|
||||
/system/health/print;
|
||||
|
||||
Then install the plugin for *fan* and *power supply unit* *state*:
|
||||
|
||||
$ScriptInstallUpdate check-health,check-health.d/state;
|
||||
|
||||
... or *temperature*:
|
||||
|
||||
$ScriptInstallUpdate check-health,check-health.d/temperature;
|
||||
|
||||
... or *voltage*:
|
||||
|
||||
$ScriptInstallUpdate check-health,check-health.d/voltage;
|
||||
|
||||
You can also combine the commands and install all or a subset of plugins
|
||||
in one go:
|
||||
|
||||
$ScriptInstallUpdate check-health,check-health.d/state,check-health.d/temperature,check-health.d/voltage;
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
|
|
|
|||
|
|
@ -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 @@ 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)
|
||||
|
||||
|
|
@ -18,10 +18,11 @@ Description
|
|||
|
||||
This script downloads, imports and updates firewall address-lists. Its main
|
||||
purpose is to block attacking ip addresses, spam hosts, command-and-control
|
||||
servers and similar malicious entities. The default configuration contains
|
||||
lists from [abuse.ch](https://abuse.ch/), [dshield.org](https://dshield.org/)
|
||||
and [blocklist.de](https://www.blocklist.de/), and
|
||||
lists from [spamhaus.org](https://spamhaus.org/) are prepared.
|
||||
servers and similar malicious entities. The default configuration contains a
|
||||
[collective list by GitHub user @stamparm](https://github.com/stamparm/ipsum),
|
||||
lists from [dshield.org](https://dshield.org/) and
|
||||
[blocklist.de](https://www.blocklist.de/), and lists from
|
||||
[spamhaus.org](https://spamhaus.org/) are prepared.
|
||||
|
||||
The address-lists are updated in place, so after initial import you will not
|
||||
see situation when the lists are not populated.
|
||||
|
|
@ -62,9 +63,8 @@ The configuration goes to `global-config-overlay`, these are the parameters:
|
|||
> your local `global-config-overlay` and modify it to your specific needs.
|
||||
|
||||
Naming a certificate for a list makes the script verify the server
|
||||
certificate, so you should add that if possible. Some certificates are
|
||||
available in my repository and downloaded automatically. Import it manually
|
||||
(menu `/certificate/`) if missing.
|
||||
certificate, so you should add that if possible. You may want to find the
|
||||
[certificate name from browser](../CERTIFICATES.md).
|
||||
|
||||
Create firewall rules to process the packets that are related to addresses
|
||||
from address-lists.
|
||||
|
|
@ -127,6 +127,11 @@ Drop packets in firewall's raw section:
|
|||
> ⚠️ **Warning**: Just again... The order of firewall rules is important. Make
|
||||
> sure they actually take effect as expected!
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
* [Certificate name from browser](../CERTIFICATES.md)
|
||||
|
||||
---
|
||||
[⬅️ Go back to main README](../README.md)
|
||||
[⬆️ Go back to top](#top)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
@ -45,13 +45,17 @@ Installing [ppp-on-up](ppp-on-up.md) may solve this.
|
|||
Configuration
|
||||
-------------
|
||||
|
||||
An address list entry is updated with current prefix and can be used in
|
||||
firewall rules, comment has to be "`ipv6-pool-`" and actual pool name:
|
||||
As an address-list entry is mandatory a dynamic one is created automatically.
|
||||
It is updated with current prefix and can be used in firewall rules.
|
||||
|
||||
Alternatively a static address-list entry can be used, where comment has to
|
||||
be "`ipv6-pool-`" and actual pool name. Use what ever list is desired, and
|
||||
create it with:
|
||||
|
||||
/ipv6/firewall/address-list/add address=2003:cf:2f0f:de00::/56 comment=ipv6-pool-isp list=extern;
|
||||
|
||||
As this entry is mandatory it is created automatically if it does not exist,
|
||||
with the comment also set for list.
|
||||
If the dynamic entry exists already you need to remove it before creating
|
||||
the static one..
|
||||
|
||||
Address list entries for specific interfaces can be updated as well. The
|
||||
interface needs to get its address from pool `isp` and the address list entry
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
@ -22,15 +22,15 @@ server (see `/system/logging`). This has some limitation, however:
|
|||
* does not work early after boot if network connectivity is not
|
||||
yet established, or breaks intermittently
|
||||
* lots of messages generate a flood of mails
|
||||
* Matrix and Telegram are not supported
|
||||
* Matrix, Ntfy and Telegram are not supported
|
||||
|
||||
The script works around the limitations, for example it does:
|
||||
|
||||
* read from `/log`, including messages from early boot
|
||||
* skip multi-repeated messages
|
||||
* rate-limit itself to mitigate flooding
|
||||
* forward via notification (which includes *e-mail*, *Matrix* and *Telegram*
|
||||
when installed and configured, see below)
|
||||
* forward via notification (which includes *e-mail*, *Matrix*, *Ntfy* and
|
||||
*Telegram* when installed and configured, see below)
|
||||
|
||||
It is intended to be run periodically from scheduler, then collects new
|
||||
log messages and forwards them via notification.
|
||||
|
|
@ -53,6 +53,12 @@ Just install the script:
|
|||
Configuration
|
||||
-------------
|
||||
|
||||
The default configuration should provide reasonable presets, filtering
|
||||
*info*, and effectively forwarding *warning* and *error*.
|
||||
|
||||
> 💡️ **Hint**: Please try with defaults first, especially if you are not
|
||||
> familiar with regular expressions!
|
||||
|
||||
The configuration goes to `global-config-overlay`, these are the parameters:
|
||||
|
||||
* `LogForwardFilter`: define topics *not* to be forwarded
|
||||
|
|
|
|||
|
|
@ -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 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)
|
||||
|
||||
|
|
@ -46,6 +46,15 @@ The Matrix server is connected via encrypted https, and certificate
|
|||
verification is applied. So make sure you have the certificate chain for
|
||||
your server in device's certificate store.
|
||||
|
||||
The example below is for `matrix.org`, which uses a trust chain from *Google
|
||||
Trust Services*. Run this to import the required certificate:
|
||||
|
||||
$CertificateAvailable "GTS Root R4";
|
||||
|
||||
Replace the CA certificate name with what ever is needed for your server.
|
||||
You may want to find the
|
||||
[certificate name from browser](../../CERTIFICATES.md).
|
||||
|
||||
### From other device
|
||||
|
||||
If you have setup your Matrix *notification account* before just reuse that.
|
||||
|
|
@ -120,6 +129,7 @@ function available:
|
|||
See also
|
||||
--------
|
||||
|
||||
* [Certificate name from browser](../../CERTIFICATES.md)
|
||||
* [Send notifications via e-mail](notification-email.md)
|
||||
* [Send notifications via Ntfy](notification-ntfy.md)
|
||||
* [Send notifications via Telegram](notification-telegram.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)
|
||||
|
||||
|
|
@ -52,6 +52,12 @@ basic authentication. Configure `NtfyServerUser` and `NtfyServerPass` for this.
|
|||
Even authentication via access token is possible, adding it as password with
|
||||
a blank username.
|
||||
|
||||
Also available is `NtfyServerToken` to add a bearer token for authentication.
|
||||
|
||||
For a custom service installing an additional certificate may be required.
|
||||
You may want to install that certificate manually, after finding the
|
||||
[certificate name from browser](../../CERTIFICATES.md).
|
||||
|
||||
Usage and invocation
|
||||
--------------------
|
||||
|
||||
|
|
@ -82,6 +88,7 @@ function available:
|
|||
See also
|
||||
--------
|
||||
|
||||
* [Certificate name from browser](../../CERTIFICATES.md)
|
||||
* [Send notifications via e-mail](notification-email.md)
|
||||
* [Send notifications via Matrix](notification-matrix.md)
|
||||
* [Send notifications via Telegram](notification-telegram.md)
|
||||
|
|
|
|||
BIN
doc/mod/notification-telegram.d/getchatid.avif
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
|
|
@ -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)
|
||||
|
||||
|
|
@ -38,14 +38,21 @@ create your own bot:
|
|||
|
||||

|
||||
|
||||
Now open a chat with your bot and start it by clicking the `START` button.
|
||||
Set that token from *BotFather* (use your own!) to `TelegramTokenId`, for
|
||||
now just temporarily:
|
||||
|
||||
Open just another chat with [GetIDs Bot](https://t.me/getidsbot), again start
|
||||
with the `START` button. It will send you some information, including the
|
||||
`id`, just below `You`.
|
||||
:set TelegramTokenId "5214364459:AAHLwf1o7ybbKDo6pY24Kd2bZ5rjCakDXTc";
|
||||
|
||||
Now open a chat with your bot and start it by clicking the `START` button,
|
||||
then send your first message. Any text will do. On your device run
|
||||
`$GetTelegramChatId` to retrieve the chat id:
|
||||
|
||||
$GetTelegramChatId;
|
||||
|
||||

|
||||
|
||||
Finally edit `global-config-overlay`, add `TelegramTokenId` with the token
|
||||
from *BotFather* and `TelegramChatId` with your id from *GetIDs Bot*. Then
|
||||
from *BotFather* and `TelegramChatId` with your retrieved chat id. Then
|
||||
reload the configuration.
|
||||
|
||||
> ℹ️ **Info**: Copy relevant configuration from
|
||||
|
|
@ -54,9 +61,13 @@ reload the configuration.
|
|||
|
||||
### Notifications to a group
|
||||
|
||||
Sending notifications to a group is possible as well. Add your bot and the
|
||||
*GetIDs Bot* to a group, then use the group's id (which starts with a dash)
|
||||
for `TelegramChatId`. Then remove *GetIDs Bot* from group.
|
||||
Sending notifications to a group is possible as well. Add your bot to a group
|
||||
and make it an admin (required for read access!) and send a message and run
|
||||
`$GetTelegramChatId` again. Then use that chat id (which starts with a dash)
|
||||
for `TelegramChatId`.
|
||||
|
||||
Groups can enable the `Topics` feature. Use `TelegramThreadId` to send to a
|
||||
specific topic in a group.
|
||||
|
||||
Usage and invocation
|
||||
--------------------
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
@ -34,12 +34,8 @@ Usage and invocation
|
|||
Call the function `$SSHKeysImport` with key and user as parameter to
|
||||
import that key:
|
||||
|
||||
$SSHKeysImport "ssh-rsa AAAAB3Nza...QYZk8= user" admin;
|
||||
|
||||
Starting with RouterOS *7.12beta1* support for keys of type `ed25519` has
|
||||
been added:
|
||||
|
||||
$SSHKeysImport "ssh-ed25519 AAAAC3Nza...ZVugJT user" admin;
|
||||
$SSHKeysImport "ssh-rsa AAAAB3Nza...QYZk8= user" admin;
|
||||
|
||||
The third part of the key (`user` in this example) is inherited as
|
||||
`key-owner` in RouterOS. Also the `MD5` fingerprint is recorded, this helps
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
@ -53,19 +53,23 @@ Note that using a name in DoH url may introduce a chicken-and-egg issue!
|
|||
Adding a static DNS record has the same result for the url, but always
|
||||
resolves to the same address.
|
||||
|
||||
/ip/dns/static/add name="dns.nextdns.io" address=199.247.16.158;
|
||||
/tool/netwatch/add comment="doh" host=199.247.16.158;
|
||||
/ip/dns/static/add name="cloudflare-dns.com" address=1.1.1.1;
|
||||
/tool/netwatch/add comment="doh" host=1.1.1.1;
|
||||
|
||||
Be aware that you have to keep the ip address in sync with real world
|
||||
manually!
|
||||
|
||||
Importing a certificate automatically is possible, at least if available in
|
||||
the repository (see `certs` sub directory).
|
||||
Importing a certificate automatically is possible. You may want to find the
|
||||
[certificate name from browser](../CERTIFICATES.md).
|
||||
|
||||
/tool/netwatch/add comment="doh, doh-cert=DigiCert Global Root G2" host=1.1.1.1;
|
||||
/tool/netwatch/add comment="doh, doh-cert=DigiCert Global Root CA" host=9.9.9.9;
|
||||
/tool/netwatch/add comment="doh, doh-cert=DigiCert Global Root G3" host=9.9.9.9;
|
||||
/tool/netwatch/add comment="doh, doh-cert=GTS Root R1" host=8.8.8.8;
|
||||
|
||||
> ⚠️ **Warning**: Combining these techniques can cause some confusion and
|
||||
> troubles! Chances are that a service uses different certificates based
|
||||
> on indicated server name.
|
||||
|
||||
Sometimes using just one specific (possibly internal) DNS server may be
|
||||
desired, with fallback in case it fails. This is possible as well:
|
||||
|
||||
|
|
@ -87,6 +91,7 @@ Also this allows to update host address, see option `resolve`.
|
|||
See also
|
||||
--------
|
||||
|
||||
* [Certificate name from browser](../CERTIFICATES.md)
|
||||
* [Notify on host up and down](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)
|
||||
|
||||
|
|
@ -66,9 +66,9 @@ notification is sent.
|
|||
Getting the escaping right may be troublesome. Please consider adding a
|
||||
script in `/system/script`, then running that from hook.
|
||||
|
||||
### Count threshould
|
||||
### Count threshold
|
||||
|
||||
The count threshould (default is 5 checks) is configurable as well:
|
||||
The count threshold (default is 5 checks) is configurable as well:
|
||||
|
||||
/tool/netwatch/add comment="notify, name=example.com, count=10" host=104.18.144.11;
|
||||
|
||||
|
|
@ -81,19 +81,24 @@ suppress notification if the parent host is down:
|
|||
/tool/netwatch/add comment="notify, name=example.com, parent=gateway" host=93.184.216.34;
|
||||
|
||||
Note that every configured parent in a chain increases the check count
|
||||
threshould by one.
|
||||
threshold by one.
|
||||
|
||||
### Update from DNS
|
||||
|
||||
The host address can be updated dynamically. Give extra parameter `resolve`
|
||||
with a resolvable name:
|
||||
|
||||
/tool/netwatch/add comment="notify, name=example.com, resolve=example.com";
|
||||
/tool/netwatch/add comment="notify, name=example.com, resolve=example.com" host=0.0;
|
||||
|
||||
This supports multiple A or AAAA records for a name just fine, even a CNAME
|
||||
This supports multiple A records for a name just fine, even a CNAME
|
||||
to those. An update happens only if no more record with the configured host
|
||||
address is found.
|
||||
|
||||
The address family is preserved, so if you want AAAA records (for IPv6)
|
||||
use this:
|
||||
|
||||
/tool/netwatch/add comment="notify, name=example.com, resolve=example.com" host=::;
|
||||
|
||||
### No notification on host down
|
||||
|
||||
Also suppressing the notification on host down is possible with parameter
|
||||
|
|
@ -125,7 +130,7 @@ included verbatim into the notification.
|
|||
It is possible to add a link in notification, that is added below the
|
||||
formatted notification text.
|
||||
|
||||
/tool/netwatch/add comment="notify, name=example.com, resolve=example.com, link=https://example.com/";
|
||||
/tool/netwatch/add comment="notify, name=example.com, resolve=example.com, link=https://example.com/" host=0.0;
|
||||
|
||||
Tips & Tricks
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||