Skip to content
Snippets Groups Projects
Commit c242ddc2 authored by Bob Mottram's avatar Bob Mottram
Browse files

Simple usb backups which don't use cryptfs

parent d830d8bc
No related branches found
No related tags found
No related merge requests found
......@@ -375,7 +375,12 @@ remove_option="$2"
if [[ "$backup_device" == "remove" ]]; then
remove_option=$1
fi
if [[ "$backup_device" == "detect" || "$backup_device" == "auto"* ]]; then
simple_backup=
if [[ "$backup_device" == "simple" || "$backup_device" == "detect" || "$backup_device" == "auto"* ]]; then
if [[ "$backup_device" == "simple" ]]; then
# shellcheck disable=SC2034
simple_backup=1
fi
backup_device=$(detect_connected_drives)
if [[ "$backup_device" != 'sd'* ]]; then
echo $'No backup device was detected'
......
......@@ -967,7 +967,12 @@ function get_restore_app {
backup_device="$1"
if [[ "$backup_device" == "detect" || "$backup_device" == "auto"* ]]; then
simple_backup=
if [[ "$backup_device" == "simple" || "$backup_device" == "detect" || "$backup_device" == "auto"* ]]; then
if [[ "$backup_device" == "simple" ]]; then
# shellcheck disable=SC2034
simple_backup=1
fi
backup_device=$(detect_connected_drives)
if [[ "$backup_device" != 'sd'* ]]; then
echo $'No backup device was detected'
......
......@@ -181,8 +181,11 @@ function backup_mount_drive {
cryptsetup close encrypted_usb
# mount the encrypted backup drive
if cryptsetup open --type luks "$USB_DRIVE" encrypted_usb; then
USB_DRIVE=/dev/mapper/encrypted_usb
# shellcheck disable=SC2154,SC2086
if [ ! $simple_backup ]; then
if cryptsetup open --type luks "$USB_DRIVE" encrypted_usb; then
USB_DRIVE=/dev/mapper/encrypted_usb
fi
fi
if ! mount "$USB_DRIVE" "$USB_MOUNT"; then
echo $"There was a problem mounting the USB drive to $USB_MOUNT"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment