initial commit
This commit is contained in:
commit
fa5291f6d1
4 changed files with 787 additions and 0 deletions
21
hello-world.rsc
Normal file
21
hello-world.rsc
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: hello-world.rsc
|
||||
# Copyright (c) 2023 Christian Hesse <mail@eworm.de>
|
||||
# https://git.eworm.de/cgit/routeros-scripts-custom/about/COPYING.md
|
||||
#
|
||||
# hello-world demo script
|
||||
# https://git.eworm.de/cgit/routeros-scripts-custom/about/doc/hello-world.md
|
||||
|
||||
:local 0 "hello-world.rsc";
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:global LogPrintExit2;
|
||||
:global ScriptFromTerminal;
|
||||
:global SendNotification2;
|
||||
|
||||
:if ([ $ScriptFromTerminal $0 ] = true) do={
|
||||
$LogPrintExit2 info $0 ("Hello world!") false;
|
||||
} else={
|
||||
$SendNotification2 ({ origin=$0; subject="Hello..."; message="... world!" });
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue