diff options
author | Christian Hesse <mail@eworm.de> | 2024-03-06 15:28:55 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-03-12 15:27:15 +0100 |
commit | 8d020a4de84cc86f0328a79c6e27bf87a35d45ba (patch) | |
tree | 9c2b98fae75338493fe5b5119aa3bbcfd3755f67 | |
parent | b8bd64bac5b9925d84d1baa0eef8dbd511b738a9 (diff) |
backup-upload: drop main function, use :do with on-error
-rw-r--r-- | backup-upload.rsc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/backup-upload.rsc b/backup-upload.rsc index c2b3285..2b42730 100644 --- a/backup-upload.rsc +++ b/backup-upload.rsc @@ -12,8 +12,8 @@ :global GlobalFunctionsReady; :while ($GlobalFunctionsReady != true) do={ :delay 500ms; } -:local Main do={ - :local ScriptName [ :tostr $1 ]; +:do { + :local ScriptName [ :jobname ]; :global BackupPassword; :global BackupRandomDelay; @@ -45,7 +45,7 @@ } :if ([ $ScriptLock $ScriptName ] = false) do={ - :return false; + :error false; } $WaitFullyConnected; @@ -153,6 +153,4 @@ :if ($Failed = 1) do={ :error "An error occured!"; } -} - -$Main [ :jobname ]; +} on-error={ } |