aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-12-06 15:17:57 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-12-06 15:17:57 +0100
commit69b724ccb959cce783ccef4fc339f314ae5d97b7 (patch)
tree2a8e7ff583d6efabcd6b3b0b17ecf75a3b0c60af
parent43d0f9f371945b2f6178ba2de13227251683d414 (diff)
downloadrouteros-scripts-custom-69b724ccb959cce783ccef4fc339f314ae5d97b7.tar.gz
routeros-scripts-custom-69b724ccb959cce783ccef4fc339f314ae5d97b7.tar.zst
hello-world: use $ExitError to indicate unintentional errornextmain
-rw-r--r--hello-world.rsc5
1 files changed, 4 insertions, 1 deletions
diff --git a/hello-world.rsc b/hello-world.rsc
index e3ebf8a..2064bfd 100644
--- a/hello-world.rsc
+++ b/hello-world.rsc
@@ -9,6 +9,7 @@
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
+:local ExitOK false;
:do {
:local ScriptName [ :jobname ];
@@ -21,4 +22,6 @@
} else={
$SendNotification2 ({ origin=$ScriptName; subject="Hello..."; message="... world!" });
}
-} on-error={ }
+} on-error={
+ :global ExitError; $ExitError $ExitOK [ :jobname ];
+}