Compare commits
27 commits
1c7b9999e0
...
4742294f59
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4742294f59 | ||
|
|
7297c419df | ||
|
|
497c4c97dc | ||
|
|
daeb173dbc | ||
|
|
4acbd6449e | ||
|
|
9db7f4494c | ||
|
|
2d0c79160d | ||
|
|
b6e72f9a9f | ||
|
|
1b53b52ac6 | ||
|
|
f77cc07338 | ||
|
|
094215aec7 | ||
|
|
d60ee59e77 | ||
|
|
3926d12070 | ||
|
|
5dbd419d1a | ||
|
|
ac6aefd34c | ||
|
|
518a4c329f | ||
|
|
9ef3ba5479 | ||
|
|
84c49c0f7e | ||
|
|
bc174d7f1f | ||
|
|
678fc3307e | ||
|
|
1ac0147fce | ||
|
|
1f6c43d5ce | ||
|
|
544e8094de | ||
|
|
d4979146f9 | ||
|
|
ca487376d6 | ||
|
|
ea9e843ae9 | ||
|
|
94514a7c75 |
|
|
@ -4,7 +4,7 @@ Initial commands
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
@ -26,7 +26,7 @@ Run the complete base installation:
|
||||||
:if (!((($CertSettings->"builtin-trust-anchors") = "trusted" || \
|
:if (!((($CertSettings->"builtin-trust-anchors") = "trusted" || \
|
||||||
($CertSettings->"builtin-trust-store") ~ "fetch" || \
|
($CertSettings->"builtin-trust-store") ~ "fetch" || \
|
||||||
($CertSettings->"builtin-trust-store") = "all") && \
|
($CertSettings->"builtin-trust-store") = "all") && \
|
||||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CertCommonName . "\" ] ]") ]] > 0)) do={
|
[ :len [ /certificate/builtin/find where common-name=$CertCommonName ] ] > 0)) do={
|
||||||
:put "Importing certificate...";
|
:put "Importing certificate...";
|
||||||
/tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value;
|
/tool/fetch ($BaseUrl . "certs/" . $CertFileName) dst-path=$CertFileName as-value;
|
||||||
:delay 1s;
|
:delay 1s;
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 8.5 KiB |
|
|
@ -4,7 +4,7 @@ RouterOS Scripts
|
||||||
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
[](https://github.com/eworm-de/routeros-scripts/stargazers)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/network)
|
[](https://github.com/eworm-de/routeros-scripts/network)
|
||||||
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
[](https://github.com/eworm-de/routeros-scripts/watchers)
|
||||||
[](https://mikrotik.com/download/changelogs/)
|
[](https://mikrotik.com/download/changelogs/)
|
||||||
[](https://t.me/routeros_scripts)
|
[](https://t.me/routeros_scripts)
|
||||||
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A4ZXBD6YS2W8J)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@
|
||||||
:local State [ $IfThenElse (($CertVal->"expired") = true) "expired" "is about to expire" ];
|
:local State [ $IfThenElse (($CertVal->"expired") = true) "expired" "is about to expire" ];
|
||||||
|
|
||||||
$SendNotification2 ({ origin=$ScriptName; \
|
$SendNotification2 ({ origin=$ScriptName; \
|
||||||
subject=([ $SymbolForNotification "warning-sign" ] . "Certificate warning: " . ($CertVal->"name")); \
|
subject=([ $SymbolForNotification "lock-with-ink-pen,warning-sign" ] . "Certificate warning: " . ($CertVal->"name")); \
|
||||||
message=("A certificate on " . $Identity . " " . $State . ".\n\n" . [ $FormatInfo $Cert ]) });
|
message=("A certificate on " . $Identity . " " . $State . ".\n\n" . [ $FormatInfo $Cert ]) });
|
||||||
$LogPrint info $ScriptName ("The certificate '" . ($CertVal->"name") . "' " . $State . \
|
$LogPrint info $ScriptName ("The certificate '" . ($CertVal->"name") . "' " . $State . \
|
||||||
", it is invalid after " . ($CertVal->"invalid-after") . ".");
|
", it is invalid after " . ($CertVal->"invalid-after") . ".");
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ markdown -f toc,idanchor "${1}" | sed \
|
||||||
-e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \
|
-e 's/href="\([-_\./[:alnum:]]*\)\.md\(#[-[:alnum:]]*\)\?"/href="\1.html\2"/g' \
|
||||||
-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' \
|
-e '/<h[1234] /s| id="\(.*\)">| id="\L\1">|' \
|
||||||
-e '/<h[1234] /s|-2[1789cd]-||g' -e '/<h[1234] /s|--26-amp-3b-||g' \
|
-e '/<h[1234] /s|-2[1789cd]-||g' -e '/<h[1234] /s|--26-amp-3b-||g' \
|
||||||
-e '/^<pre>/s|pre|pre onclick="CopyToClipboard(this)"|g' \
|
-e '/^<pre>/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \
|
||||||
-e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|'
|
-e '/The above link may be broken on code hosting sites/s|blockquote|blockquote style="display: none;"|'
|
||||||
|
|
||||||
sed \
|
sed \
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ instead.</p></blockquote>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p id="heading" class="heading">[<span id="hostname">MikroTik</span>] <span id="subject">ℹ️ Subject</span></p>
|
<p id="heading" class="heading">[<span id="hostname">MikroTik</span>] <span id="subject">ℹ️ Subject</span></p>
|
||||||
<pre id="message">Message</pre>
|
<pre id="message">Message</pre>
|
||||||
<p id="link" class="hint">🔗 <span id="link-text" class="link">https://eworm.de/</span></p>
|
<p id="link" class="hint">🔗 <span id="link-text" class="link">https://rsc.eworm.de/</span></p>
|
||||||
<p id="queued" class="hint">⏰ This message was queued since <i><span id="queued-since">2025-10-29 16:06:18</span></i> and may be obsolete.</p>
|
<p id="queued" class="hint">⏰ This message was queued since <i><span id="queued-since">2025-10-29 16:06:18</span></i> and may be obsolete.</p>
|
||||||
<p id="cut" class="hint">✂️ The message was too long and has been truncated, cut off <i><span id="cut-percent">13</span>%</i>!</p>
|
<p id="cut" class="hint">✂️ The message was too long and has been truncated, cut off <i><span id="cut-percent">13</span>%</i>!</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -40,7 +40,7 @@ instead.</p></blockquote>
|
||||||
<p>Hostname: <input type="text" value="MikroTik" onchange="update(this, 'hostname')"></p>
|
<p>Hostname: <input type="text" value="MikroTik" onchange="update(this, 'hostname')"></p>
|
||||||
<p>Subject: <input type="text" size=50 value="ℹ️ Subject" onchange="update(this, 'subject')"></p>
|
<p>Subject: <input type="text" size=50 value="ℹ️ Subject" onchange="update(this, 'subject')"></p>
|
||||||
<p>Message: <textarea id="w3review" name="w3review" rows="4" cols="50" onchange="update(this, 'message')">Message</textarea></p>
|
<p>Message: <textarea id="w3review" name="w3review" rows="4" cols="50" onchange="update(this, 'message')">Message</textarea></p>
|
||||||
<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://eworm.de/" onchange="update(this, 'link-text')"></p>
|
<p><input type="checkbox" onclick="visible(this, 'link')"> Show link: <input type="text" value="https://rsc.eworm.de/" onchange="update(this, 'link-text')"></p>
|
||||||
<p><input type="checkbox" onclick="visible(this, 'queued')"> Queued since <input type="text" value="2025-10-29 16:06:18" onchange="update(this, 'queued-since')"></p>
|
<p><input type="checkbox" onclick="visible(this, 'queued')"> Queued since <input type="text" value="2025-10-29 16:06:18" onchange="update(this, 'queued-since')"></p>
|
||||||
<p><input type="checkbox" onclick="visible(this, 'cut')"> Cut-off with <input type="number" min=1 max=99 value=13 onchange="update(this, 'cut-percent')"> percent</p>
|
<p><input type="checkbox" onclick="visible(this, 'cut')"> Cut-off with <input type="number" min=1 max=99 value=13 onchange="update(this, 'cut-percent')"> percent</p>
|
||||||
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 16 KiB |
BIN
doc/check-certificates.d/notification-01-warn.avif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
doc/check-certificates.d/notification-02-renew.avif
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
|
@ -19,9 +19,10 @@ Description
|
||||||
This script tries to download and renew certificates, then notifies about
|
This script tries to download and renew certificates, then notifies about
|
||||||
certificates that are still about to expire.
|
certificates that are still about to expire.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
doc/check-perpetual-license.d/notification-01-warn.avif
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
doc/check-perpetual-license.d/notification-02-renew.avif
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB |
|
|
@ -20,9 +20,10 @@ On *Cloud Hosted Router* (*CHR*) the licensing is perpetual: Buy once, use
|
||||||
forever - but it needs regular renewal. This script checks licensing state
|
forever - but it needs regular renewal. This script checks licensing state
|
||||||
and sends a notification to warn before expiration.
|
and sends a notification to warn before expiration.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
BIN
doc/check-routeros-update.d/notification-01-found.avif
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
doc/check-routeros-update.d/notification-02-neighbor.avif
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
BIN
doc/check-routeros-update.d/terminal.avif
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -31,13 +31,14 @@ automatically is supported.
|
||||||
> of view. At the same time it can be source of serve breakage. So test
|
> of view. At the same time it can be source of serve breakage. So test
|
||||||
> versions in lab and read
|
> versions in lab and read
|
||||||
> [changelog ↗️](https://mikrotik.com/download/changelogs/) and
|
> [changelog ↗️](https://mikrotik.com/download/changelogs/) and
|
||||||
> [forum ↗️](https://forum.mikrotik.com/viewforum.php?f=21) before deploying
|
> [forum ↗️](https://forum.mikrotik.com/c/announcements/5) before deploying
|
||||||
> to your production environment! Automatic updates should be handled
|
> to your production environment! Automatic updates should be handled
|
||||||
> with care!
|
> with care!
|
||||||
|
|
||||||
### Sample notification
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
@ -87,6 +88,8 @@ Be notified when run from scheduler or run it manually:
|
||||||
|
|
||||||
If an update is found you can install it right away.
|
If an update is found you can install it right away.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Installing script [packages-update](packages-update.md) gives extra options.
|
Installing script [packages-update](packages-update.md) gives extra options.
|
||||||
|
|
||||||
Tips & Tricks
|
Tips & Tricks
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.8 KiB |
BIN
doc/log-forward.d/notification-01-info.avif
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
doc/log-forward.d/notification-02-warn.avif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 6 KiB |
|
|
@ -35,9 +35,10 @@ The script works around the limitations, for example it does:
|
||||||
It is intended to be run periodically from scheduler, then collects new
|
It is intended to be run periodically from scheduler, then collects new
|
||||||
log messages and forwards them via notification.
|
log messages and forwards them via notification.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||
|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ import that key:
|
||||||
$SSHKeysImport "ssh-rsa AAAAB3Nza...QYZk8= user" admin;
|
$SSHKeysImport "ssh-rsa AAAAB3Nza...QYZk8= user" admin;
|
||||||
|
|
||||||
The third part of the key (`user` in this example) is inherited as
|
The third part of the key (`user` in this example) is inherited as
|
||||||
`key-owner` in RouterOS (or `info` starting with RouterOS 7.21beta2). Also
|
`info` in RouterOS (or `key-owner` with RouterOS 7.19.x and before). Also
|
||||||
the `MD5` fingerprint is recorded, this helps to audit and verify the
|
the `MD5` fingerprint is recorded, this helps to audit and verify the
|
||||||
available keys.
|
available keys.
|
||||||
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 5 KiB |
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.8 KiB |
|
|
@ -39,15 +39,19 @@ div.notification {
|
||||||
div.content {
|
div.content {
|
||||||
padding-left: 60px;
|
padding-left: 60px;
|
||||||
}
|
}
|
||||||
|
hr {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
img.logo {
|
img.logo {
|
||||||
float: left;
|
float: left;
|
||||||
border-radius: 50%;
|
/* border-radius: 50%; */
|
||||||
}
|
}
|
||||||
p.foot {
|
p.foot {
|
||||||
color: #777;
|
color: #777;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
p.heading {
|
p.heading {
|
||||||
|
font-size: 120%;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|
@ -58,6 +62,8 @@ p.hint {
|
||||||
pre {
|
pre {
|
||||||
font-family: fira-mono, monospace;
|
font-family: fira-mono, monospace;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
pre.code {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
@ -69,7 +75,7 @@ pre code {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
}
|
}
|
||||||
pre::before {
|
pre.code::before {
|
||||||
content: "📋 Copy!";
|
content: "📋 Copy!";
|
||||||
float: right;
|
float: right;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
|
|
@ -97,5 +103,6 @@ td.head .bottom {
|
||||||
}
|
}
|
||||||
div.notification {
|
div.notification {
|
||||||
float: right;
|
float: right;
|
||||||
|
margin: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# Michael Gisbers <michael@gisbers.de>
|
# Michael Gisbers <michael@gisbers.de>
|
||||||
# https://rsc.eworm.de/COPYING.md
|
# https://rsc.eworm.de/COPYING.md
|
||||||
#
|
#
|
||||||
# requires RouterOS, version=7.15
|
# requires RouterOS, version=7.19
|
||||||
# requires device-mode, fetch, scheduler
|
# requires device-mode, fetch, scheduler
|
||||||
#
|
#
|
||||||
# global functions
|
# global functions
|
||||||
|
|
@ -131,7 +131,7 @@
|
||||||
:if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
|
:if ((($CertSettings->"builtin-trust-anchors") = "trusted" || \
|
||||||
($CertSettings->"builtin-trust-store") ~ $UseFor || \
|
($CertSettings->"builtin-trust-store") ~ $UseFor || \
|
||||||
($CertSettings->"builtin-trust-store") = "all") && \
|
($CertSettings->"builtin-trust-store") = "all") && \
|
||||||
[[ :parse (":return [ :len [ /certificate/builtin/find where common-name=\"" . $CommonName . "\" ] ]") ]] > 0) do={
|
[ :len [ /certificate/builtin/find where common-name=$CommonName ] ] > 0) do={
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,8 @@
|
||||||
$LogPrint warning $ScriptName ("Failed to remove message: " . $Err);
|
$LogPrint warning $ScriptName ("Failed to remove message: " . $Err);
|
||||||
}
|
}
|
||||||
} else={
|
} else={
|
||||||
:set Messages ($Messages . "\n\nOn " . $SmsVal->"timestamp" . \
|
:set Messages ($Messages . "\n\n" . [ $SymbolForNotification "incoming-envelope" ] . \
|
||||||
" type " . $SmsVal->"type" . ":\n" . $SmsVal->"message");
|
"On " . $SmsVal->"timestamp" . " type " . $SmsVal->"type" . ":\n" . $SmsVal->"message");
|
||||||
:foreach Hook in=$SmsForwardHooks do={
|
:foreach Hook in=$SmsForwardHooks do={
|
||||||
:if ($Phone~($Hook->"allowed-number") && ($SmsVal->"message")~($Hook->"match")) do={
|
:if ($Phone~($Hook->"allowed-number") && ($SmsVal->"message")~($Hook->"match")) do={
|
||||||
:if ([ $ValidateSyntax ($Hook->"command") ] = true) do={
|
:if ([ $ValidateSyntax ($Hook->"command") ] = true) do={
|
||||||
|
|
|
||||||