From 5f1656b7ce439e6567803299eaddca215e8cb7cf Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 23 Apr 2024 13:53:04 +0200 Subject: backup-cloud: clean up and simplify code --- backup-cloud.rsc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/backup-cloud.rsc b/backup-cloud.rsc index 1085f05..bdc6c34 100644 --- a/backup-cloud.rsc +++ b/backup-cloud.rsc @@ -49,13 +49,11 @@ :execute { :global BackupPassword; - # we are not interested in output, but print is - # required to fetch information from cloud - /system/backup/cloud/print as-value; - :delay 20ms; - :if ([ :len [ /system/backup/cloud/find ] ] > 0) do={ + + :local Backup ([ /system/backup/cloud/find ]->0); + :if ([ :typeof $Backup ] = "id") do={ /system/backup/cloud/upload-file action=create-and-upload \ - password=$BackupPassword replace=[ get ([ find ]->0) name ]; + password=$BackupPassword replace=$Backup; } else={ /system/backup/cloud/upload-file action=create-and-upload \ password=$BackupPassword; -- cgit v1.2.3-70-g09d2