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
commitb8bd64bac5b9925d84d1baa0eef8dbd511b738a9 (patch)
tree21f1b36d1fa48110dcfaa7b6c069958170126b31
parent3eb8fad5ae36334b2f4c56c6641d453eee5b0136 (diff)
backup-partition: drop main function, use :do with on-error
-rw-r--r--backup-partition.rsc10
1 files changed, 4 insertions, 6 deletions
diff --git a/backup-partition.rsc b/backup-partition.rsc
index 74dccfe..1238fab 100644
--- a/backup-partition.rsc
+++ b/backup-partition.rsc
@@ -12,14 +12,14 @@
:global GlobalFunctionsReady;
:while ($GlobalFunctionsReady != true) do={ :delay 500ms; }
-:local Main do={
- :local ScriptName [ :tostr $1 ];
+:do {
+ :local ScriptName [ :jobname ];
:global LogPrintExit2;
:global ScriptLock;
:if ([ $ScriptLock $ScriptName ] = false) do={
- :return false;
+ :error false;
}
:if ([ :len [ /partitions/find ] ] < 2) do={
@@ -47,6 +47,4 @@
$LogPrintExit2 error $ScriptName ("Failed saving configuration to partition '" . \
$FallbackTo . "'!") true;
}
-}
-
-$Main [ :jobname ];
+} on-error={ }