update the hello world script to latest version
This commit is contained in:
parent
5db54265d5
commit
330d293c88
1 changed files with 7 additions and 7 deletions
|
|
@ -1,16 +1,16 @@
|
|||
#!rsc by RouterOS
|
||||
# RouterOS script: hello-world
|
||||
# Copyright (c) 2023-2025 Christian Hesse <mail@eworm.de>
|
||||
# Copyright (c) 2023-2026 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
|
||||
|
||||
:global GlobalFunctionsReady;
|
||||
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
|
||||
|
||||
:local ExitOK false;
|
||||
:do {
|
||||
onerror Err {
|
||||
:global GlobalConfigReady; :global GlobalFunctionsReady;
|
||||
:retry { :if ($GlobalConfigReady != true || $GlobalFunctionsReady != true) \
|
||||
do={ :error ("Global config and/or functions not ready."); }; } delay=500ms max=50;
|
||||
:local ScriptName [ :jobname ];
|
||||
|
||||
:global LogPrint;
|
||||
|
|
@ -22,6 +22,6 @@
|
|||
} else={
|
||||
$SendNotification2 ({ origin=$ScriptName; subject="Hello..."; message="... world!" });
|
||||
}
|
||||
} on-error={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ];
|
||||
} do={
|
||||
:global ExitError; $ExitError $ExitOK [ :jobname ] $Err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue