Restoring cryptpad with duplicity style directory

This commit is contained in:
Bob Mottram 2017-08-25 11:47:25 +01:00
parent 99d7f7baa6
commit 4890393e4c
1 changed files with 10 additions and 4 deletions

View File

@ -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