mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2026-06-10 20:52:37 +00:00
Compare commits
No commits in common. "main" and "change-142" have entirely different histories.
main
...
change-142
34 changed files with 61 additions and 98 deletions
|
|
@ -230,7 +230,7 @@ everything is up-to-date it will not produce any output.
|
||||||
If the update includes news or requires configuration changes a notification
|
If the update includes news or requires configuration changes a notification
|
||||||
is sent - in addition to terminal output and log messages.
|
is sent - in addition to terminal output and log messages.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Adding a script
|
Adding a script
|
||||||
---------------
|
---------------
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
|
do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
:global BackupFileNameDate;
|
|
||||||
:global BackupPassword;
|
:global BackupPassword;
|
||||||
:global BackupRandomDelay;
|
:global BackupRandomDelay;
|
||||||
:global BackupSendBinary;
|
:global BackupSendBinary;
|
||||||
|
|
@ -74,9 +73,7 @@
|
||||||
|
|
||||||
# filename based on identity
|
# filename based on identity
|
||||||
:local DirName ("tmpfs/" . $ScriptName);
|
:local DirName ("tmpfs/" . $ScriptName);
|
||||||
:local Clock [ /system/clock/get ];
|
:local FileName [ $CleanName ($Identity . "." . $Domain) ];
|
||||||
:local FileName [ $CleanName ($Identity . "." . $Domain . [ $IfThenElse \
|
|
||||||
($BackupFileNameDate = true) ("-" . $Clock->"date" . "-" . $Clock->"time") "" ] ) ];
|
|
||||||
:local FilePath ($DirName . "/" . $FileName);
|
:local FilePath ($DirName . "/" . $FileName);
|
||||||
:local BackupFile "none";
|
:local BackupFile "none";
|
||||||
:local ExportFile "none";
|
:local ExportFile "none";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
|
do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
|
||||||
:local ScriptName [ :jobname ];
|
:local ScriptName [ :jobname ];
|
||||||
|
|
||||||
:global BackupFileNameDate;
|
|
||||||
:global BackupPassword;
|
:global BackupPassword;
|
||||||
:global BackupRandomDelay;
|
:global BackupRandomDelay;
|
||||||
:global BackupSendBinary;
|
:global BackupSendBinary;
|
||||||
|
|
@ -73,9 +72,7 @@
|
||||||
|
|
||||||
# filename based on identity
|
# filename based on identity
|
||||||
:local DirName ("tmpfs/" . $ScriptName);
|
:local DirName ("tmpfs/" . $ScriptName);
|
||||||
:local Clock [ /system/clock/get ];
|
:local FileName [ $CleanName ($Identity . "." . $Domain) ];
|
||||||
:local FileName [ $CleanName ($Identity . "." . $Domain . [ $IfThenElse \
|
|
||||||
($BackupFileNameDate = true) ("-" . $Clock->"date" . "-" . $Clock->"time") "" ] ) ];
|
|
||||||
:local FilePath ($DirName . "/" . $FileName);
|
:local FilePath ($DirName . "/" . $FileName);
|
||||||
:local BackupFile "none";
|
:local BackupFile "none";
|
||||||
:local ExportFile "none";
|
:local ExportFile "none";
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ markdown -f toc,idanchor "${1}" | sed \
|
||||||
-e '/<h[1234] /s|-2[1789cd]-||g' \
|
-e '/<h[1234] /s|-2[1789cd]-||g' \
|
||||||
-e '/<h[1234] /s|-3[f]-||g' \
|
-e '/<h[1234] /s|-3[f]-||g' \
|
||||||
-e '/^<pre>/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \
|
-e '/^<pre>/s|pre|pre class="code" onclick="CopyToClipboard(this)"|g' \
|
||||||
-e '/<img src=".*" alt="[a-z]\+: .*" \/>/s|alt="\([a-z]\+\):|class="\1" alt="\1:|' \
|
|
||||||
-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 \
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
</span>
|
|
||||||
|
|
||||||
<p class="foot">RouterOS Scripts documentation generated on <i>__DATE__</i> for <i>__VERSION__</i><br />
|
<p class="foot">RouterOS Scripts documentation generated on <i>__DATE__</i> for <i>__VERSION__</i><br />
|
||||||
Copyright © 2013-2026 Christian Hesse <mail@eworm.de></p>
|
Copyright © 2013-2026 Christian Hesse <mail@eworm.de></p>
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
<script type="text/javascript" src="__GENERAL__/clipboard.js"></script>
|
<script type="text/javascript" src="__GENERAL__/clipboard.js"></script>
|
||||||
</head><body>
|
</head><body>
|
||||||
|
|
||||||
<table class="head"><tr>
|
<table><tr>
|
||||||
<td><img src="__GENERAL__/eworm-meadow.avif" alt="eworm on meadow" /></td>
|
<td><img src="__GENERAL__/eworm-meadow.avif" alt="eworm on meadow" /></td>
|
||||||
<td><img src="__GENERAL__/qr-code.png" alt="QR code: rsc.eworm.de" /></td>
|
<td><img src="__GENERAL__/qr-code.png" alt="QR code: rsc.eworm.de" /></td>
|
||||||
<td class="head"><span class="top">RouterOS Scripts</span><br />
|
<td class="head"><span class="top">RouterOS Scripts</span><br />
|
||||||
|
|
@ -14,4 +14,3 @@
|
||||||
</tr></table>
|
</tr></table>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<span class="markdown">
|
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ something that differentiates? Color it!</p>
|
||||||
<p>Then right-click, click "<i>Take Screenshot</i>" and finally select the
|
<p>Then right-click, click "<i>Take Screenshot</i>" and finally select the
|
||||||
logo and download it.</p>
|
logo and download it.</p>
|
||||||
|
|
||||||
<p><img src="logo-color.d/browser-01.avif" class="screenshot" alt="screenshot: browser 01"></p>
|
<p><img src="logo-color.d/browser-01.avif" alt="Screenshot Browser 01"></p>
|
||||||
<p><img src="logo-color.d/browser-02.avif" class="screenshot" alt="screenshot: browser 02"></p>
|
<p><img src="logo-color.d/browser-02.avif" alt="Screenshot Browser 02"></p>
|
||||||
<p><img src="logo-color.d/browser-03.avif" class="screenshot" alt="screenshot: browser 03"></p>
|
<p><img src="logo-color.d/browser-03.avif" alt="Screenshot Browser 03"></p>
|
||||||
|
|
||||||
<p>(This example is with
|
<p>(This example is with
|
||||||
<a href="https://www.mozilla.org/firefox/">Mozilla Firefox ↗️</a>. The workflow
|
<a href="https://www.mozilla.org/firefox/">Mozilla Firefox ↗️</a>. The workflow
|
||||||
|
|
|
||||||
|
|
@ -263,10 +263,6 @@ Notes
|
||||||
|
|
||||||
/save next Another satisfied user. 😊 Next, please!
|
/save next Another satisfied user. 😊 Next, please!
|
||||||
|
|
||||||
#### Notename
|
|
||||||
|
|
||||||
/save notename The `notename` is just an example from my note listing. Use the literal name of the note you want to see!
|
|
||||||
|
|
||||||
#### Off-topic
|
#### Off-topic
|
||||||
|
|
||||||
/save off-topic Please note this group is not about MikroTik RouterOS in general, but [RouterOS Scripts](https://rsc.eworm.de/). Your request is not about scripting at all, so please discuss somewhere else. See the [MikroTik RouterOS users (english)](https://t.me/RouterOS_users_english) group or official Mikrotik forums (https://forum.mikrotik.com/).
|
/save off-topic Please note this group is not about MikroTik RouterOS in general, but [RouterOS Scripts](https://rsc.eworm.de/). Your request is not about scripting at all, so please discuss somewhere else. See the [MikroTik RouterOS users (english)](https://t.me/RouterOS_users_english) group or official Mikrotik forums (https://forum.mikrotik.com/).
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ This script uploads
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,6 @@ Configuration
|
||||||
|
|
||||||
The configuration goes to `global-config-overlay`, these are the parameters:
|
The configuration goes to `global-config-overlay`, these are the parameters:
|
||||||
|
|
||||||
* `BackupFileNameDate`: whether to add date & time in filenames
|
|
||||||
* `BackupSendBinary`: whether to send binary backup
|
* `BackupSendBinary`: whether to send binary backup
|
||||||
* `BackupSendExport`: whether to send configuration export
|
* `BackupSendExport`: whether to send configuration export
|
||||||
* `BackupSendGlobalConfig`: whether to send `global-config-overlay`
|
* `BackupSendGlobalConfig`: whether to send `global-config-overlay`
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ configuration export (`/export terse show-sensitive`) to external server.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
@ -40,7 +40,6 @@ Configuration
|
||||||
|
|
||||||
The configuration goes to `global-config-overlay`, these are the parameters:
|
The configuration goes to `global-config-overlay`, these are the parameters:
|
||||||
|
|
||||||
* `BackupFileNameDate`: whether to add date & time in filenames
|
|
||||||
* `BackupSendBinary`: whether to send binary backup
|
* `BackupSendBinary`: whether to send binary backup
|
||||||
* `BackupSendExport`: whether to send configuration export
|
* `BackupSendExport`: whether to send configuration export
|
||||||
* `BackupSendGlobalConfig`: whether to send `global-config-overlay`
|
* `BackupSendGlobalConfig`: whether to send `global-config-overlay`
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ certificates that are still about to expire.
|
||||||
|
|
||||||
### Sample notifications
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -40,27 +40,27 @@ sensors available in hardware:
|
||||||
|
|
||||||
#### CPU utilization
|
#### CPU utilization
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### RAM utilization (low available RAM)
|
#### RAM utilization (low available RAM)
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### Voltage
|
#### Voltage
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
#### Temperature
|
#### Temperature
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
#### PSU state
|
#### PSU state
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ upgrades. Currently supported LTE hardware:
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ and sends a notification to warn before expiration.
|
||||||
|
|
||||||
### Sample notifications
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ automatically is supported.
|
||||||
|
|
||||||
### Sample notifications
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
@ -88,7 +88,7 @@ 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.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ and modify it to your needs.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ passphrase to a pseudo-random string daily.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ log messages and forwards them via notification.
|
||||||
|
|
||||||
### Sample notifications
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ Call the function `$InspectVar` with a variable as parameter:
|
||||||
|
|
||||||
$InspectVar $ModeButton;
|
$InspectVar $ModeButton;
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
[⬅️ Go back to main README](../../README.md)
|
[⬅️ Go back to main README](../../README.md)
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ It expects an IP address in CIDR notation as argument.
|
||||||
|
|
||||||
$IPCalc 192.168.88.1/24;
|
$IPCalc 192.168.88.1/24;
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### IPCalcReturn
|
### IPCalcReturn
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ the information in a named array.
|
||||||
|
|
||||||
:put ([ $IPCalcReturn 192.168.88.1/24 ]->"broadcast");
|
:put ([ $IPCalcReturn 192.168.88.1/24 ]->"broadcast");
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
---
|
---
|
||||||
[⬅️ Go back to main README](../../README.md)
|
[⬅️ Go back to main README](../../README.md)
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ and the [First Login ↗️](https://gotify.net/docs/first-login) setup. Once
|
||||||
you have a user and account you can start creating apps. Each app is an
|
you have a user and account you can start creating apps. Each app is an
|
||||||
independent notification feed for a device or application.
|
independent notification feed for a device or application.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
On creation apps are assigned a *Token* for authentification, you will need
|
On creation apps are assigned a *Token* for authentification, you will need
|
||||||
that in configuration.
|
that in configuration.
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ and write first part of the configuration:
|
||||||
|
|
||||||
$SetupMatrixAuthenticate "@example:matrix.org" "v3ry-s3cr3t";
|
$SetupMatrixAuthenticate "@example:matrix.org" "v3ry-s3cr3t";
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The configuration is written to a new configuration snippet
|
The configuration is written to a new configuration snippet
|
||||||
`global-config-overlay.d/mod/notification-matrix`.
|
`global-config-overlay.d/mod/notification-matrix`.
|
||||||
|
|
@ -94,7 +94,7 @@ the invite.
|
||||||
|
|
||||||
$SetupMatrixJoinRoom "!WUcxpSjKyxSGelouhA:matrix.org";
|
$SetupMatrixJoinRoom "!WUcxpSjKyxSGelouhA:matrix.org";
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The configuration is appended to the configuration snippet
|
The configuration is appended to the configuration snippet
|
||||||
`global-config-overlay.d/mod/notification-matrix`.
|
`global-config-overlay.d/mod/notification-matrix`.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ Configuration
|
||||||
Open Telegram, then start a chat with [BotFather ↗️](https://t.me/BotFather) and
|
Open Telegram, then start a chat with [BotFather ↗️](https://t.me/BotFather) and
|
||||||
create your own bot:
|
create your own bot:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Set that token from *BotFather* (use your own!) to `TelegramTokenId`, for
|
Set that token from *BotFather* (use your own!) to `TelegramTokenId`, for
|
||||||
now just temporarily:
|
now just temporarily:
|
||||||
|
|
@ -49,7 +49,7 @@ then send your first message. Any text will do. On your device run
|
||||||
|
|
||||||
$GetTelegramChatId;
|
$GetTelegramChatId;
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Finally edit `global-config-overlay`, add `TelegramTokenId` with the token
|
Finally edit `global-config-overlay`, add `TelegramTokenId` with the token
|
||||||
from *BotFather* and `TelegramChatId` with your retrieved chat id. Then
|
from *BotFather* and `TelegramChatId` with your retrieved chat id. Then
|
||||||
|
|
@ -104,7 +104,7 @@ Tips & Tricks
|
||||||
You can use a profile photo for your bot to make it recognizable. Open the
|
You can use a profile photo for your bot to make it recognizable. Open the
|
||||||
chat with [BotFather ↗️](https://t.me/BotFather) and set it there.
|
chat with [BotFather ↗️](https://t.me/BotFather) and set it there.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Have a look at my [Logo Color Changer](../../contrib/logo-color.html)
|
Have a look at my [Logo Color Changer](../../contrib/logo-color.html)
|
||||||
to create a colored version of this scripts' logo.
|
to create a colored version of this scripts' logo.
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ The function `$ScriptRunOnce` expects an URL (or name if
|
||||||
|
|
||||||
$ScriptRunOnce https://rsc.eworm.de/main/doc/mod/scriptrunonce.d/hello-world.rsc;
|
$ScriptRunOnce https://rsc.eworm.de/main/doc/mod/scriptrunonce.d/hello-world.rsc;
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Giving multiple scripts is possible, separated by comma.
|
Giving multiple scripts is possible, separated by comma.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ optional parent host is not down to avoid false alerts.
|
||||||
|
|
||||||
### Sample notifications
|
### Sample notifications
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ A broadband interface with SMS support is required.
|
||||||
|
|
||||||
### Sample notification
|
### Sample notification
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Requirements and installation
|
Requirements and installation
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
||||||
|
|
@ -61,13 +61,13 @@ containing `! identity` (exclamation mark, optional space and system's
|
||||||
identity). To query all dynamic ip addresses form a device named "*MikroTik*"
|
identity). To query all dynamic ip addresses form a device named "*MikroTik*"
|
||||||
send `! MikroTik`, followed by `/ip/address/print where dynamic;`.
|
send `! MikroTik`, followed by `/ip/address/print where dynamic;`.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Devices can be grouped to chat with them simultaneously. The default group
|
Devices can be grouped to chat with them simultaneously. The default group
|
||||||
"*all*" can be activated by sending `! @all`, which will make all devices
|
"*all*" can be activated by sending `! @all`, which will make all devices
|
||||||
act on your commands.
|
act on your commands.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Send a single exclamation mark or non-existent identity to make all
|
Send a single exclamation mark or non-existent identity to make all
|
||||||
devices passive again.
|
devices passive again.
|
||||||
|
|
@ -78,7 +78,7 @@ Let's assume you received a message from a device before, and want to send
|
||||||
a command to that device. No need to activate it, you can just reply to
|
a command to that device. No need to activate it, you can just reply to
|
||||||
that message.
|
that message.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Associated messages are cleared on device reboot.
|
Associated messages are cleared on device reboot.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,12 +42,6 @@ div.content {
|
||||||
hr {
|
hr {
|
||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
img.notification {
|
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
|
||||||
}
|
|
||||||
img.screenshot {
|
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
|
||||||
}
|
|
||||||
img.logo {
|
img.logo {
|
||||||
float: left;
|
float: left;
|
||||||
/* border-radius: 50%; */
|
/* border-radius: 50%; */
|
||||||
|
|
@ -72,7 +66,6 @@ pre {
|
||||||
pre.code {
|
pre.code {
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
box-shadow: 3px 3px 7px rgba(100,100,100,0.7);
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: 6px 10px;
|
padding: 6px 10px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
|
|
|
||||||
|
|
@ -90,9 +90,7 @@
|
||||||
# Toggle this to disable color output in terminal/cli.
|
# Toggle this to disable color output in terminal/cli.
|
||||||
:global TerminalColorOutput true;
|
:global TerminalColorOutput true;
|
||||||
|
|
||||||
# This defines whether to add date & time in filenames, what backups to generate,
|
# This defines what backups to generate and what password to use.
|
||||||
# the password to use, and what random delay (between 0 and given seconds) to apply.
|
|
||||||
:global BackupFileNameDate false;
|
|
||||||
:global BackupSendBinary false;
|
:global BackupSendBinary false;
|
||||||
:global BackupSendExport true;
|
:global BackupSendExport true;
|
||||||
:global BackupSendGlobalConfig true;
|
:global BackupSendGlobalConfig true;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
# Git commit id & info, expected configuration version
|
# Git commit id & info, expected configuration version
|
||||||
:global CommitId "unknown";
|
:global CommitId "unknown";
|
||||||
:global CommitInfo "unknown";
|
:global CommitInfo "unknown";
|
||||||
:global ExpectedConfigVersion 143;
|
:global ExpectedConfigVersion 142;
|
||||||
|
|
||||||
# global variables not to be changed by user
|
# global variables not to be changed by user
|
||||||
:global GlobalFunctionsReady false;
|
:global GlobalFunctionsReady false;
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
|
|
||||||
:for I from=0 to=([ :len $Input ] - 1) do={
|
:for I from=0 to=([ :len $Input ] - 1) do={
|
||||||
:local Char [ :pick $Input $I ];
|
:local Char [ :pick $Input $I ];
|
||||||
:if ([ :typeof [ :find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={
|
:if ([ :typeof [ find "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" $Char ] ] = "nil") do={
|
||||||
:do {
|
:do {
|
||||||
:if ([ :len $Return ] = 0) do={
|
:if ([ :len $Return ] = 0) do={
|
||||||
:error true;
|
:error true;
|
||||||
|
|
@ -812,15 +812,10 @@
|
||||||
# check if DNS is resolving
|
# check if DNS is resolving
|
||||||
:set IsDNSResolving do={
|
:set IsDNSResolving do={
|
||||||
:do {
|
:do {
|
||||||
:local I 1;
|
:resolve "low-ttl.eworm.de";
|
||||||
:retry {
|
|
||||||
:set I ($I ^ 1);
|
|
||||||
:resolve ("low-ttl.eworm." . ({ "de"; "net" }->$I));
|
|
||||||
} delay=50ms max=6;
|
|
||||||
} on-error={
|
} on-error={
|
||||||
:return false;
|
:return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1205,12 +1200,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
/file/remove [ find where name=$DirName ];
|
/file/remove $DirName;
|
||||||
} do={
|
} do={
|
||||||
:if (!($Err ~ "no such item")) do={
|
$LogPrint error $0 ("Removing directory '" . $DirName . "' failed: " . $Err);
|
||||||
$LogPrint error $0 ("Removing directory '" . $DirName . "' failed: " . $Err);
|
:return false;
|
||||||
:return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1236,12 +1229,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
/file/remove [ find where name=$FileName ];
|
/file/remove $FileName;
|
||||||
} do={
|
} do={
|
||||||
:if (!($Err ~ "no such item")) do={
|
$LogPrint error $0 ("Removing file '" . $FileName . "' failed: " . $Err);
|
||||||
$LogPrint error $0 ("Removing file '" . $FileName . "' failed: " . $Err);
|
:return false;
|
||||||
:return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
:return true;
|
:return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1301,8 +1292,7 @@
|
||||||
:global SymbolForNotification;
|
:global SymbolForNotification;
|
||||||
:global ValidateSyntax;
|
:global ValidateSyntax;
|
||||||
|
|
||||||
:if ([ $CertificateAvailable "ISRG Root X2" "fetch" ] = false || \
|
:if ([ $CertificateAvailable "Root YE" "fetch" ] = false) do={
|
||||||
[ $CertificateAvailable "Root YE" "fetch" ] = false) do={
|
|
||||||
$LogPrint warning $0 ("Downloading certificate failed, trying without.");
|
$LogPrint warning $0 ("Downloading certificate failed, trying without.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
:local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ];
|
:local Pool [ /ipv6/pool/get [ find where prefix=$PdPrefix ] name ];
|
||||||
:if ([ :len [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={
|
:if ([ :len [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ] ] = 0) do={
|
||||||
/ipv6/firewall/address-list/add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool) dynamic=yes;
|
/ipv6/firewall/address-list/add list=("ipv6-pool-" . $Pool) address=:: comment=("ipv6-pool-" . $Pool) dynamic=yes;
|
||||||
$LogPrint info $ScriptName ("Added dynamic ipv6 address list entry for ipv6-pool-" . $Pool);
|
$LogPrint warning $ScriptName ("Added dynamic ipv6 address list entry for ipv6-pool-" . $Pool);
|
||||||
}
|
}
|
||||||
:local AddrList [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ];
|
:local AddrList [ /ipv6/firewall/address-list/find where comment=("ipv6-pool-" . $Pool) ];
|
||||||
:local OldPrefix [ /ipv6/firewall/address-list/get ($AddrList->0) address ];
|
:local OldPrefix [ /ipv6/firewall/address-list/get ($AddrList->0) address ];
|
||||||
|
|
|
||||||
|
|
@ -115,15 +115,13 @@
|
||||||
|
|
||||||
:local Data false;
|
:local Data false;
|
||||||
:onerror Err {
|
:onerror Err {
|
||||||
:local I 1;
|
|
||||||
:retry {
|
:retry {
|
||||||
:set I ($I ^ 1);
|
|
||||||
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
:set Data ([ /tool/fetch check-certificate=yes-without-crl output=user \
|
||||||
http-header-field=({ "accept: application/dns-message" }) \
|
http-header-field=({ "accept: application/dns-message" }) \
|
||||||
url=(($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
url=(($DohServer->"doh-url") . "?dns=" . [ :convert to=base64 ([ :rndstr length=2 ] . \
|
||||||
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm" . \
|
"\01\00" . "\00\01" . "\00\00" . "\00\00" . "\00\00" . "\09doh-check\05eworm\02de\00" . \
|
||||||
({ "\02de"; "\03net" }->$I) . "\00" . "\00\10" . "\00\01") ]) as-value ]->"data");
|
"\00\10" . "\00\01") ]) as-value ]->"data");
|
||||||
} delay=500ms max=6;
|
} delay=1s max=3;
|
||||||
} do={
|
} do={
|
||||||
$LogPrint warning $ScriptName ("Request to DoH server " . ($DohServer->"doh-url") . \
|
$LogPrint warning $ScriptName ("Request to DoH server " . ($DohServer->"doh-url") . \
|
||||||
" failed: " . $Err);
|
" failed: " . $Err);
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@
|
||||||
140="The scripts 'lease-script' was renamed to 'dhcpv4-server-lease', configuration was updated automatically.";
|
140="The scripts 'lease-script' was renamed to 'dhcpv4-server-lease', configuration was updated automatically.";
|
||||||
141="Introduced script 'dhcpv6-client-lease' to run several scripts on IPv6 DHCP client lease.";
|
141="Introduced script 'dhcpv6-client-lease' to run several scripts on IPv6 DHCP client lease.";
|
||||||
142="Added a setting for 'mod/notification-email' to check availability of certificate chain.";
|
142="Added a setting for 'mod/notification-email' to check availability of certificate chain.";
|
||||||
143="Made backup scripts 'backup-email' and 'backup-upload' support date & time in filenames.";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Migration steps to be applied on script updates
|
# Migration steps to be applied on script updates
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue