From e6a686187c3d3c981b7ab86b4cbce46fc6466da4 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:03:43 +0100 Subject: add doc/mod/notification-telegram --- README.md | 1 + doc/backup-cloud.md | 3 +- doc/backup-upload.md | 3 +- doc/check-certificates.md | 2 +- doc/check-health.md | 3 +- doc/check-lte-firmware-upgrade.md | 3 +- doc/check-routeros-update.md | 3 +- doc/collect-wireless-mac.md | 3 +- doc/daily-psk.md | 3 +- doc/log-forward.md | 3 +- doc/mod/notification-telegram.d/newbot.avif | Bin 0 -> 35870 bytes doc/mod/notification-telegram.md | 58 ++++++++++++++++++++++++++++ doc/netwatch-notify.md | 3 +- doc/sms-forward.md | 5 ++- 14 files changed, 81 insertions(+), 12 deletions(-) create mode 100644 doc/mod/notification-telegram.d/newbot.avif create mode 100644 doc/mod/notification-telegram.md diff --git a/README.md b/README.md index 9d4d858..69461a9 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ Available modules * [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md) +* [Send notifications via Telegram](doc/mod/notification-telegram.md) Contact ------- diff --git a/doc/backup-cloud.md b/doc/backup-cloud.md index 4df14fd..c768be1 100644 --- a/doc/backup-cloud.md +++ b/doc/backup-cloud.md @@ -30,7 +30,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `BackupPassword`: password to encrypt the backup with * `BackupRandomDelay`: delay up to amount of seconds when run from scheduler -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). Usage and invocation -------------------- diff --git a/doc/backup-upload.md b/doc/backup-upload.md index 1e17d62..cbda74e 100644 --- a/doc/backup-upload.md +++ b/doc/backup-upload.md @@ -36,7 +36,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `BackupUploadUser`: username for server authentication * `BackupUploadPass`: password for server authentication -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). ### Issues with SFTP client diff --git a/doc/check-certificates.md b/doc/check-certificates.md index f6a4d22..bddcd5a 100644 --- a/doc/check-certificates.md +++ b/doc/check-certificates.md @@ -27,7 +27,7 @@ Configuration ------------- The expiry notifications just require notification settings for e-mail, -matrix and/or telegram. +matrix and/or [telegram](mod/notification-telegram.md). For automatic download and renewal of certificates you need configuration in `global-config-overlay`, these are the parameters: diff --git a/doc/check-health.md b/doc/check-health.md index 778c080..81a9f75 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -56,7 +56,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `CheckHealthVoltageLow`: value (in volt*10) giving a hard lower limit * `CheckHealthVoltagePercent`: percentage value to trigger voltage jumps -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). --- [◀ Go back to main README](../README.md) diff --git a/doc/check-lte-firmware-upgrade.md b/doc/check-lte-firmware-upgrade.md index a9da4a2..e5027a8 100644 --- a/doc/check-lte-firmware-upgrade.md +++ b/doc/check-lte-firmware-upgrade.md @@ -35,7 +35,8 @@ Just install the script: Configuration ------------- -Notification setting are required for e-mail, matrix and/or telegram. +Notification setting are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). See also -------- diff --git a/doc/check-routeros-update.md b/doc/check-routeros-update.md index da74639..b8f6183 100644 --- a/doc/check-routeros-update.md +++ b/doc/check-routeros-update.md @@ -47,7 +47,8 @@ safe versions from a web server. The configuration goes to * `SafeUpdateUrl`: url to check for safe update, the channel (`long-term`, `stable` or `testing`) is appended -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). Usage and invocation -------------------- diff --git a/doc/collect-wireless-mac.md b/doc/collect-wireless-mac.md index 3120749..4e629a5 100644 --- a/doc/collect-wireless-mac.md +++ b/doc/collect-wireless-mac.md @@ -40,7 +40,8 @@ On first run a disabled access list entry acting as marker (with comment "`--- collected above ---`") is added. Move this entry to define where new entries are to be added. -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). Usage and invocation -------------------- diff --git a/doc/daily-psk.md b/doc/daily-psk.md index 28baac0..0d6ddef 100644 --- a/doc/daily-psk.md +++ b/doc/daily-psk.md @@ -51,7 +51,8 @@ Then add an access list entry: / interface wireless access-list add comment="Daily PSK" interface=wl-daily private-pre-shared-key="ToBeChangedDaily"; -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). --- [◀ Go back to main README](../README.md) diff --git a/doc/log-forward.md b/doc/log-forward.md index 3a0f3be..6ff652f 100644 --- a/doc/log-forward.md +++ b/doc/log-forward.md @@ -46,7 +46,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `LogForwardIncludeMessage`: define message text to be forwarded (even if filter matches) -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md)m. --- [◀ Go back to main README](../README.md) diff --git a/doc/mod/notification-telegram.d/newbot.avif b/doc/mod/notification-telegram.d/newbot.avif new file mode 100644 index 0000000..1fc7355 Binary files /dev/null and b/doc/mod/notification-telegram.d/newbot.avif differ diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md new file mode 100644 index 0000000..511d9a2 --- /dev/null +++ b/doc/mod/notification-telegram.md @@ -0,0 +1,58 @@ +Send notifications via Telegram +=============================== + +[◀ Go back to main README](../../README.md) + +> ℹ️️ **Info**: This module can not be used on its own but requires the base +> installation. See [main README](../../README.md) for details. + +Description +----------- + +This module adds support for sending notifications via +[Telegram](https://telegram.org/) via bot api. A queue is used to make sure +notifications are not lost on failure but sent later. + +Requirements and installation +----------------------------- + +Just install the module: + + $ScriptInstallUpdate mod/notification-telegram; + +Also install Telegram on at least one of your mobile and/or desktop devices +and create an account. + +Configuration +------------- + +Open Telegram, then start a chat with [BotFather](https://t.me/BotFather) and +create your own bot: + +![create new bot](notification-telegram.d/newbot.avif) + +Now open a chat with your bot and start it by clicking the `START` button. + +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`. + +Finally edit `global-config-overlay`, add `TelegramTokenId` with the token +from *BotFather* and `TelegramChatId` with your id from *GetIDs Bot*. Then +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. + +Usage and invocation +-------------------- + +There's nothing special to do. Every script or function sending a notification +will now send it to your Telegram account. + +--- +[◀ Go back to main README](../../README.md) +[▲ Go back to top](#top) diff --git a/doc/netwatch-notify.md b/doc/netwatch-notify.md index c9917cb..47fa5f3 100644 --- a/doc/netwatch-notify.md +++ b/doc/netwatch-notify.md @@ -88,7 +88,8 @@ powered off, but accessibility is of interest. Go and get your coffee ☕️ before sending the print job. -Also notification settings are required for e-mail, matrix and/or telegram. +Also notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). Tips & Tricks ------------- diff --git a/doc/sms-forward.md b/doc/sms-forward.md index 417f462..9028045 100644 --- a/doc/sms-forward.md +++ b/doc/sms-forward.md @@ -31,8 +31,9 @@ Just install the script: Configuration ------------- -Notification settings are required for e-mail, matrix and/or telegram. Also -you have to enable receiving of SMS: +Notification settings are required for e-mail, matrix and/or +[telegram](mod/notification-telegram.md). Also you have to enable receiving +of SMS: / tool sms set receive-enabled=yes; -- cgit v1.2.3-54-g00ecf From 07fc5c898ad36debad96d06e3a65fa06ccdadde8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:03:25 +0100 Subject: add doc/mod/notification-matrix --- README.md | 1 + doc/backup-cloud.md | 3 ++- doc/backup-upload.md | 3 ++- doc/check-certificates.md | 3 ++- doc/check-health.md | 3 ++- doc/check-lte-firmware-upgrade.md | 3 ++- doc/check-routeros-update.md | 3 ++- doc/collect-wireless-mac.md | 3 ++- doc/daily-psk.md | 3 ++- doc/log-forward.md | 3 ++- doc/mod/notification-matrix.md | 45 +++++++++++++++++++++++++++++++++++++++ doc/mod/notification-telegram.md | 5 +++++ doc/netwatch-notify.md | 3 ++- doc/sms-forward.md | 3 ++- 14 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 doc/mod/notification-matrix.md diff --git a/README.md b/README.md index 69461a9..78925bb 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ Available modules * [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md) +* [Send notifications via Matrix](doc/mod/notification-matrix.md) * [Send notifications via Telegram](doc/mod/notification-telegram.md) Contact diff --git a/doc/backup-cloud.md b/doc/backup-cloud.md index c768be1..0761982 100644 --- a/doc/backup-cloud.md +++ b/doc/backup-cloud.md @@ -30,7 +30,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `BackupPassword`: password to encrypt the backup with * `BackupRandomDelay`: delay up to amount of seconds when run from scheduler -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). Usage and invocation diff --git a/doc/backup-upload.md b/doc/backup-upload.md index cbda74e..72781ba 100644 --- a/doc/backup-upload.md +++ b/doc/backup-upload.md @@ -36,7 +36,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `BackupUploadUser`: username for server authentication * `BackupUploadPass`: password for server authentication -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). ### Issues with SFTP client diff --git a/doc/check-certificates.md b/doc/check-certificates.md index bddcd5a..a553e6a 100644 --- a/doc/check-certificates.md +++ b/doc/check-certificates.md @@ -27,7 +27,8 @@ Configuration ------------- The expiry notifications just require notification settings for e-mail, -matrix and/or [telegram](mod/notification-telegram.md). +[matrix](mod/notification-matrix.md) and/or +[telegram](mod/notification-telegram.md). For automatic download and renewal of certificates you need configuration in `global-config-overlay`, these are the parameters: diff --git a/doc/check-health.md b/doc/check-health.md index 81a9f75..f6900ce 100644 --- a/doc/check-health.md +++ b/doc/check-health.md @@ -56,7 +56,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `CheckHealthVoltageLow`: value (in volt*10) giving a hard lower limit * `CheckHealthVoltagePercent`: percentage value to trigger voltage jumps -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). --- diff --git a/doc/check-lte-firmware-upgrade.md b/doc/check-lte-firmware-upgrade.md index e5027a8..704a86b 100644 --- a/doc/check-lte-firmware-upgrade.md +++ b/doc/check-lte-firmware-upgrade.md @@ -35,7 +35,8 @@ Just install the script: Configuration ------------- -Notification setting are required for e-mail, matrix and/or +Notification setting are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). See also diff --git a/doc/check-routeros-update.md b/doc/check-routeros-update.md index b8f6183..cac1850 100644 --- a/doc/check-routeros-update.md +++ b/doc/check-routeros-update.md @@ -47,7 +47,8 @@ safe versions from a web server. The configuration goes to * `SafeUpdateUrl`: url to check for safe update, the channel (`long-term`, `stable` or `testing`) is appended -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). Usage and invocation diff --git a/doc/collect-wireless-mac.md b/doc/collect-wireless-mac.md index 4e629a5..5425f76 100644 --- a/doc/collect-wireless-mac.md +++ b/doc/collect-wireless-mac.md @@ -40,7 +40,8 @@ On first run a disabled access list entry acting as marker (with comment "`--- collected above ---`") is added. Move this entry to define where new entries are to be added. -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). Usage and invocation diff --git a/doc/daily-psk.md b/doc/daily-psk.md index 0d6ddef..d204691 100644 --- a/doc/daily-psk.md +++ b/doc/daily-psk.md @@ -51,7 +51,8 @@ Then add an access list entry: / interface wireless access-list add comment="Daily PSK" interface=wl-daily private-pre-shared-key="ToBeChangedDaily"; -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). --- diff --git a/doc/log-forward.md b/doc/log-forward.md index 6ff652f..1ac6a04 100644 --- a/doc/log-forward.md +++ b/doc/log-forward.md @@ -46,7 +46,8 @@ The configuration goes to `global-config-overlay`, these are the parameters: * `LogForwardIncludeMessage`: define message text to be forwarded (even if filter matches) -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md)m. --- diff --git a/doc/mod/notification-matrix.md b/doc/mod/notification-matrix.md new file mode 100644 index 0000000..e357b5b --- /dev/null +++ b/doc/mod/notification-matrix.md @@ -0,0 +1,45 @@ +Send notifications via Matrix +============================= + +[◀ Go back to main README](../../README.md) + +> ℹ️️ **Info**: This module can not be used on its own but requires the base +> installation. See [main README](../../README.md) for details. + +Description +----------- + +This module adds support for sending notifications via +[Matrix](https://matrix.org/) via client server api. A queue is used to +make sure notifications are not lost on failure but sent later. + +Requirements and installation +----------------------------- + +Just install the module: + + $ScriptInstallUpdate mod/notification-matrix; + +Also install a Matrix client on at least one of your mobile and/or desktop +devices and create an account. + +Configuration +------------- + +Edit `global-config-overlay`, add `MatrixHomeServer`, `MatrixAccessToken` and +`MatrixRoom`. Then reload the configuration. + +Usage and invocation +-------------------- + +There's nothing special to do. Every script or function sending a notification +will now send it to your Matrix account. + +See also +-------- + +* [Send notifications via Telegram](notification-telegram.md) + +--- +[◀ Go back to main README](../../README.md) +[▲ Go back to top](#top) diff --git a/doc/mod/notification-telegram.md b/doc/mod/notification-telegram.md index 511d9a2..435694e 100644 --- a/doc/mod/notification-telegram.md +++ b/doc/mod/notification-telegram.md @@ -53,6 +53,11 @@ Usage and invocation There's nothing special to do. Every script or function sending a notification will now send it to your Telegram account. +See also +-------- + +* [Send notifications via Matrix](notification-matrix.md) + --- [◀ Go back to main README](../../README.md) [▲ Go back to top](#top) diff --git a/doc/netwatch-notify.md b/doc/netwatch-notify.md index 47fa5f3..b2f6dd0 100644 --- a/doc/netwatch-notify.md +++ b/doc/netwatch-notify.md @@ -88,7 +88,8 @@ powered off, but accessibility is of interest. Go and get your coffee ☕️ before sending the print job. -Also notification settings are required for e-mail, matrix and/or +Also notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). Tips & Tricks diff --git a/doc/sms-forward.md b/doc/sms-forward.md index 9028045..9ebae69 100644 --- a/doc/sms-forward.md +++ b/doc/sms-forward.md @@ -31,7 +31,8 @@ Just install the script: Configuration ------------- -Notification settings are required for e-mail, matrix and/or +Notification settings are required for e-mail, +[matrix](mod/notification-matrix.md) and/or [telegram](mod/notification-telegram.md). Also you have to enable receiving of SMS: -- cgit v1.2.3-54-g00ecf From 002315035c25b8569d2b6f232a6f8dfba37cf07b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:02:55 +0100 Subject: add doc/mod/inspectvar --- README.md | 1 + doc/mod/inspectvar.d/inspectvar.avif | Bin 0 -> 2891 bytes doc/mod/inspectvar.md | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 doc/mod/inspectvar.d/inspectvar.avif create mode 100644 doc/mod/inspectvar.md diff --git a/README.md b/README.md index 78925bb..fa0663c 100644 --- a/README.md +++ b/README.md @@ -224,6 +224,7 @@ Available modules * [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md) +* [Inspect variables](doc/mod/inspectvar.md) * [Send notifications via Matrix](doc/mod/notification-matrix.md) * [Send notifications via Telegram](doc/mod/notification-telegram.md) diff --git a/doc/mod/inspectvar.d/inspectvar.avif b/doc/mod/inspectvar.d/inspectvar.avif new file mode 100644 index 0000000..d4a745f Binary files /dev/null and b/doc/mod/inspectvar.d/inspectvar.avif differ diff --git a/doc/mod/inspectvar.md b/doc/mod/inspectvar.md new file mode 100644 index 0000000..d3fb3b2 --- /dev/null +++ b/doc/mod/inspectvar.md @@ -0,0 +1,33 @@ +Inspect variables +================= + +[◀ Go back to main README](../../README.md) + +> ℹ️️ **Info**: This module can not be used on its own but requires the base +> installation. See [main README](../../README.md) for details. + +Description +----------- + +RouterOS handles not just scalar variables, but also arrays - even nested. +This module adds a function to inspect variables. + +Requirements and installation +----------------------------- + +Just install the module: + + $ScriptInstallUpdate mod/inspectvar; + +Usage and invocation +-------------------- + +Call the function `$InspectVar` with a variable as parameter: + + $InspectVar $ModeButton + +![InspectVar](inspectvar.d/inspectvar.avif) + +--- +[◀ Go back to main README](../../README.md) +[▲ Go back to top](#top) -- cgit v1.2.3-54-g00ecf From e9953c361267f10fd15d3280ccd985062c1dde28 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:03:10 +0100 Subject: add doc/mod/ipcalc --- README.md | 1 + doc/mod/ipcalc.d/ipcalc.avif | Bin 0 -> 1791 bytes doc/mod/ipcalc.d/ipcalcreturn.avif | Bin 0 -> 1283 bytes doc/mod/ipcalc.md | 53 +++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 doc/mod/ipcalc.d/ipcalc.avif create mode 100644 doc/mod/ipcalc.d/ipcalcreturn.avif create mode 100644 doc/mod/ipcalc.md diff --git a/README.md b/README.md index fa0663c..752f5e8 100644 --- a/README.md +++ b/README.md @@ -225,6 +225,7 @@ Available modules * [Manage ports in bridge](doc/mod/bridge-port-to.md) * [Manage VLANs on bridge ports](doc/mod/bridge-port-vlan.md) * [Inspect variables](doc/mod/inspectvar.md) +* [IP address calculation](doc/mod/ipcalc.md) * [Send notifications via Matrix](doc/mod/notification-matrix.md) * [Send notifications via Telegram](doc/mod/notification-telegram.md) diff --git a/doc/mod/ipcalc.d/ipcalc.avif b/doc/mod/ipcalc.d/ipcalc.avif new file mode 100644 index 0000000..022f325 Binary files /dev/null and b/doc/mod/ipcalc.d/ipcalc.avif differ diff --git a/doc/mod/ipcalc.d/ipcalcreturn.avif b/doc/mod/ipcalc.d/ipcalcreturn.avif new file mode 100644 index 0000000..d858bb1 Binary files /dev/null and b/doc/mod/ipcalc.d/ipcalcreturn.avif differ diff --git a/doc/mod/ipcalc.md b/doc/mod/ipcalc.md new file mode 100644 index 0000000..a3e7fc8 --- /dev/null +++ b/doc/mod/ipcalc.md @@ -0,0 +1,53 @@ +IP address calculation +====================== + +[◀ Go back to main README](../../README.md) + +> ℹ️️ **Info**: This module can not be used on its own but requires the base +> installation. See [main README](../../README.md) for details. + +Description +----------- + +This module adds functions for IP address calculation. + +Requirements and installation +----------------------------- + +Just install the module: + + $ScriptInstallUpdate mod/ipcalc; + +Usage and invocation +-------------------- + +### IPCalc + +The function `$IPCalc` prints information to terminal, including: + +* address +* netmask +* network in CIDR notation +* minimum host address +* maximum host address +* broadcast address + +It expects an IP address in CIDR notation as argument. + + $IPCalc 192.168.88.1/24; + +![IPCalc](ipcalc.d/ipcalc.avif) + +### IPCalcReturn + +The function `$IPCalcReturn` expects an IP address in CIDR notation as +argument as well. But it does not print to terminal, instead it returns +the information in a named array. + + :put ([ $IPCalcReturn 192.168.88.1/24 ]->"broadcast"); + +![IPCalcReturn](ipcalc.d/ipcalcreturn.avif) + +--- +[◀ Go back to main README](../../README.md) +[▲ Go back to top](#top) -- cgit v1.2.3-54-g00ecf From 26e471122f029b8e585e1e88e5f2fdaa1f21abd7 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 16 Nov 2021 16:03:56 +0100 Subject: add doc/mod/scriptrunonce --- README.md | 1 + doc/mod/scriptrunonce.d/hello-world.rsc | 3 +++ doc/mod/scriptrunonce.d/scriptrunonce.avif | Bin 0 -> 2466 bytes doc/mod/scriptrunonce.md | 35 +++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 doc/mod/scriptrunonce.d/hello-world.rsc create mode 100644 doc/mod/scriptrunonce.d/scriptrunonce.avif create mode 100644 doc/mod/scriptrunonce.md diff --git a/README.md b/README.md index 752f5e8..a3da7e7 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ Available modules * [IP address calculation](doc/mod/ipcalc.md) * [Send notifications via Matrix](doc/mod/notification-matrix.md) * [Send notifications via Telegram](doc/mod/notification-telegram.md) +* [Download script and run it once](doc/mod/scriptrunonce.md) Contact ------- diff --git a/doc/mod/scriptrunonce.d/hello-world.rsc b/doc/mod/scriptrunonce.d/hello-world.rsc new file mode 100644 index 0000000..17ec575 --- /dev/null +++ b/doc/mod/scriptrunonce.d/hello-world.rsc @@ -0,0 +1,3 @@ +#!rsc by RouterOS + +:put ("Hello World from " . [ / system identity get name ] . "!"); diff --git a/doc/mod/scriptrunonce.d/scriptrunonce.avif b/doc/mod/scriptrunonce.d/scriptrunonce.avif new file mode 100644 index 0000000..614c72c Binary files /dev/null and b/doc/mod/scriptrunonce.d/scriptrunonce.avif differ diff --git a/doc/mod/scriptrunonce.md b/doc/mod/scriptrunonce.md new file mode 100644 index 0000000..190ed03 --- /dev/null +++ b/doc/mod/scriptrunonce.md @@ -0,0 +1,35 @@ +Download script and run it once +=============================== + +[◀ Go back to main README](../../README.md) + +> ℹ️️ **Info**: This module can not be used on its own but requires the base +> installation. See [main README](../../README.md) for details. + +Description +----------- + +This module adds a function that downloads a script, checks for syntax +validity and runs it once. + +Requirements and installation +----------------------------- + +Just install the module: + + $ScriptInstallUpdate mod/scriptrunonce; + +Usage and invocation +-------------------- + +The function `$ScriptRunOnce` expects an url pointing to a script as parameter. + + $ScriptRunOnce https://git.eworm.de/cgit/routeros-scripts/plain/doc/mod/scriptrunonce.d/hello-world.rsc + +![ScriptRunOnce](scriptrunonce.d/scriptrunonce.avif) + +Giving multiple scripts is possible, separated by comma. + +--- +[◀ Go back to main README](../../README.md) +[▲ Go back to top](#top) -- cgit v1.2.3-54-g00ecf From d74aac8f6ad3edfdf65d4a3ee6714aae1d3ade0f Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Sun, 20 Feb 2022 23:17:16 +0100 Subject: doc/mod: notify about new documentation --- global-config | 2 +- global-config-overlay | 2 +- global-config.changes | 1 + global-functions | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/global-config b/global-config index 50e7f54..3ae4557 100644 --- a/global-config +++ b/global-config @@ -8,7 +8,7 @@ # Make sure all configuration properties are up to date and this # value is in sync with value in script 'global-functions'! -:global GlobalConfigVersion 77; +:global GlobalConfigVersion 78; # This is used for DNS and backup file. :global Domain "example.com"; diff --git a/global-config-overlay b/global-config-overlay index d8c2e0a..7d0c83d 100644 --- a/global-config-overlay +++ b/global-config-overlay @@ -8,7 +8,7 @@ # Make sure all configuration properties are up to date and this # value is in sync with value in script 'global-functions'! # Comment or remove to disable news and change notifications. -:global GlobalConfigVersion 77; +:global GlobalConfigVersion 78; # Copy configuration from global-config here and modify it. diff --git a/global-config.changes b/global-config.changes index 727b259..7e029be 100644 --- a/global-config.changes +++ b/global-config.changes @@ -86,6 +86,7 @@ ("Still running RouterOS v6, so last reminder to see https://git.eworm.de/cgit/routeros-scripts/about/#changes-for-routeros-v6") ]); 76="Added an option to suppress notifications on host down with 'netwatch-notify'."; 77="Introduced new script 'firmware-upgrade-reboot'. Handle with care!"; + 78="New documentation is online for notifications via Telegram & Matrix, variable inspection, ip address calculation and running scripts once."; }; # Migration steps to be applied on script updates diff --git a/global-functions b/global-functions index 3323f36..2b37bea 100644 --- a/global-functions +++ b/global-functions @@ -8,7 +8,7 @@ # https://git.eworm.de/cgit/routeros-scripts/about/ # expected configuration version -:global ExpectedConfigVersion 77; +:global ExpectedConfigVersion 78; # global variables not to be changed by user :global GlobalFunctionsReady false; -- cgit v1.2.3-54-g00ecf