From 357618a1a545ced696ffbfb87bb72a45b73913f8 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 4 May 2022 22:23:17 +0200 Subject: README: installing custom scripts & modules (cherry picked from commit ecde864263f8572503eeaba2ad7c806847adb594) --- README.d/12-install-custom-script.avif | Bin 0 -> 2349 bytes README.d/hello-world.rsc | 3 +++ README.md | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 README.d/12-install-custom-script.avif create mode 100644 README.d/hello-world.rsc diff --git a/README.d/12-install-custom-script.avif b/README.d/12-install-custom-script.avif new file mode 100644 index 0000000..fb53606 Binary files /dev/null and b/README.d/12-install-custom-script.avif differ diff --git a/README.d/hello-world.rsc b/README.d/hello-world.rsc new file mode 100644 index 0000000..17ec575 --- /dev/null +++ b/README.d/hello-world.rsc @@ -0,0 +1,3 @@ +#!rsc by RouterOS + +:put ("Hello World from " . [ / system identity get name ] . "!"); diff --git a/README.md b/README.md index 215274d..97cf318 100644 --- a/README.md +++ b/README.md @@ -246,6 +246,29 @@ Available modules * [Send notifications via Telegram](doc/mod/notification-telegram.md) * [Download script and run it once](doc/mod/scriptrunonce.md) +Installing custom scripts & modules +----------------------------------- + +My scripts cover a lot of use cases, but you may have your own ones. You can +still use my scripts to manage and deploy yours, by specifying `base-url` +(and `url-suffix`) for each script. + +This will fetch and install a script `hello-world.rsc` from the given url: + + $ScriptInstallUpdate hello-world.rsc "base-url=https://git.eworm.de/cgit/routeros-scripts/plain/README.d/" + +![screenshot: install custom script](README.d/12-install-custom-script.avif) + +(Yes, the example url still belongs to the repository for easy +handling - but the url can be what ever you use.) + +For a script to be considered valid it has to begin with a *magic token*. +Have a look at [any script](README.d/hello-world.rsc) and copy the first line +without modification. + +Starting a script's name with `mod/` makes it a module and it is run +automatically by `global-functions`. + Contact ------- -- cgit v1.2.3-70-g09d2