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 function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir cryptpad restore_directory_from_usb $temp_restore_dir cryptpad
if [ ! -d $temp_restore_dir$CRYPTPAD_DIR/datastore ]; then if [ ! -d $temp_restore_dir$CRYPTPAD_DIR/datastore ]; then
if [ -d $temp_restore_dir$CRYPTPAD_DIR ]; then
cp -r $temp_restore_dir$CRYPTPAD_DIR/* $CRYPTPAD_DIR/datastore/
else
systemctl start cryptpad systemctl start cryptpad
echo 'Failed to restore cryptpad' echo 'Failed to restore cryptpad'
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
exit 8736529
fi fi
else
cp -r $temp_restore_dir$CRYPTPAD_DIR/datastore/* $CRYPTPAD_DIR/datastore/ cp -r $temp_restore_dir$CRYPTPAD_DIR/datastore/* $CRYPTPAD_DIR/datastore/
fi
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
systemctl start cryptpad systemctl start cryptpad
fi fi