diff --git a/src/freedombone-app-cryptpad b/src/freedombone-app-cryptpad index 7b3e6712..ffb77383 100755 --- a/src/freedombone-app-cryptpad +++ b/src/freedombone-app-cryptpad @@ -122,7 +122,13 @@ function restore_local_cryptpad { temp_restore_dir=/root/tempcryptpad 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 + fi cp -r $temp_restore_dir$CRYPTPAD_DIR/datastore/* $CRYPTPAD_DIR/datastore/ + rm -rf $temp_restore_dir systemctl start cryptpad fi } diff --git a/src/freedombone-utils-backup b/src/freedombone-utils-backup index c50f4312..66296bcc 100755 --- a/src/freedombone-utils-backup +++ b/src/freedombone-utils-backup @@ -361,7 +361,11 @@ function restore_directory_from_usb_obnam { function restore_directory_from_usb_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1} + PASSPHRASE="$BACKUP_DUMMY_PASSWORD" duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$USB_MOUNT/backup/${2} ${1} + if [ ! "$?" = "0" ]; then + echo "WARNING: failed to restore $USB_MOUNT/backup/${2} to ${1}" + fi + PASSPHRASE= remove_backups_temp_directory } @@ -390,7 +394,8 @@ function restore_directory_from_friend_obnam { function restore_directory_from_friend_duplicity { create_backups_temp_directory - echo "$BACKUP_DUMMY_PASSWORD" | duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1} + PASSPHRASE="$BACKUP_DUMMY_PASSWORD" duplicity restore --gpg-options "$BACKUP_GPG_OPTIONS" --tempdir $BACKUP_TEMP_DIRECTORY --force file://$SERVER_DIRECTORY/backup/${2} ${1} + PASSPHRASE= remove_backups_temp_directory }