aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2024-03-06 15:28:55 +0100
committerGravatar Christian Hesse <mail@eworm.de>2024-03-12 15:27:15 +0100
commit18ed12e3f7ced88d30b53ab1e4c557d25a2df755 (patch)
treee260926da3095c7e00e3cbafe4ff88dd52ddf6fb
parent8fcb8efbea2b377f12038f983d751c99aad07fb7 (diff)
netwatch-notify: drop main function, use :do with on-error
-rw-r--r--netwatch-notify.rsc10
1 files changed, 4 insertions, 6 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc
index ce74ffa..90d26f1 100644
--- a/netwatch-notify.rsc
+++ b/netwatch-notify.rsc
@@ -11,8 +11,8 @@
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-:local Main do={
- :local ScriptName [ :tostr $1 ];
+:do {
+ :local ScriptName [ :jobname ];
:global NetwatchNotify;
@@ -76,7 +76,7 @@
}
:if ([ $ScriptLock $ScriptName ] = false) do={
- :return false;
+ :error false;
}
:local ScriptFromTerminalCached [ $ScriptFromTerminal $ScriptName ];
@@ -217,6 +217,4 @@
"since"=($Metric->"since") };
}
}
-}
-
-$Main [ :jobname ];
+} on-error={ }