From 6dcab200acb0a9fd85c90f1360e4487dacfb4f74 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Fri, 28 May 2021 17:02:34 +0200
Subject: [PATCH] create directory for restic mount

---
 plugins/transfer/restic.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/transfer/restic.sh b/plugins/transfer/restic.sh
index 6512f89..95f8a98 100644
--- a/plugins/transfer/restic.sh
+++ b/plugins/transfer/restic.sh
@@ -253,13 +253,15 @@
     # Mount backup data
     function t_restoreDoMountBackupdata(){
         local _cmd=
-        echo HINT: This feature requires fuse. It works on UNIX/ LINUX platforms - not on MS Windows.
+        echo HINT: This feature requires fuse. It works with root on UNIX/ LINUX platforms - not on MS Windows.
         echo
         if [ -z "$RESTIC_MOUNTPOINT" ]; then
             color error
             echo "ERROR: no mountpoint was set in ${STORAGEFILE}; example: restic_mountpoint = /mnt/restore"
             color reset
         else
+            j_requireUser "root"
+            test -d "$RESTIC_MOUNTPOINT" || mkdir -p $RESTIC_MOUNTPOINT
             _cmd="restic mount ${ARGS_DEFAULT} $RESTIC_MOUNTPOINT"
             test -z "${BACKUP_DIR}" || _cmd="restic mount ${ARGS_DEFAULT} --path ${BACKUP_DIR} $RESTIC_MOUNTPOINT"
             echo $_cmd
-- 
GitLab