From 4890393e4c6ca6be445a38ee711cfac4763a49e9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 25 Aug 2017 11:47:25 +0100 Subject: [PATCH] Restoring cryptpad with duplicity style directory --- src/freedombone-app-cryptpad | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/freedombone-app-cryptpad b/src/freedombone-app-cryptpad index ffb77383..7ec7d51f 100755 --- a/src/freedombone-app-cryptpad +++ b/src/freedombone-app-cryptpad @@ -123,11 +123,17 @@ function restore_local_cryptpad { function_check restore_directory_from_usb restore_directory_from_usb $temp_restore_dir cryptpad if [ ! -d $temp_restore_dir$CRYPTPAD_DIR/datastore ]; then - systemctl start cryptpad - echo 'Failed to restore cryptpad' - rm -rf $temp_restore_dir + if [ -d $temp_restore_dir$CRYPTPAD_DIR ]; then + cp -r $temp_restore_dir$CRYPTPAD_DIR/* $CRYPTPAD_DIR/datastore/ + else + systemctl start cryptpad + echo 'Failed to restore cryptpad' + rm -rf $temp_restore_dir + exit 8736529 + fi + else + cp -r $temp_restore_dir$CRYPTPAD_DIR/datastore/* $CRYPTPAD_DIR/datastore/ fi - cp -r $temp_restore_dir$CRYPTPAD_DIR/datastore/* $CRYPTPAD_DIR/datastore/ rm -rf $temp_restore_dir systemctl start cryptpad fi