]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
fix issues with backkup volume
authorBastian Dehn <hhaalo@arcor.de>
Sun, 25 May 2025 07:30:35 +0000 (09:30 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 25 May 2025 07:30:35 +0000 (09:30 +0200)
backupmount

index bb8ab256148b8bcc4d48d11f68153ee0aa0e641a..e7491ace71a4fca17e34afd9f2b8b08c51e6eeb1 100755 (executable)
@@ -23,8 +23,8 @@ partition_mount()
 {
        local media="$1"
        local partition=$(cat config.yaml \
-               | yq --raw-output ".media\"$media\".partition")
-       [ "$partition" == "null" ] \
+               | yq --raw-output ".media.\"$media\".partition")
+       [ "$partition" != "null" ] \
                || errlog "config.yaml partition for $media missing" \
                || return $?
        [ -b "$partition" ] \
@@ -34,7 +34,7 @@ partition_mount()
        local backup_path=$(cat config.yaml \
                | yq --raw-output ".backup_path")
        [ "$backup_path" == "null" ] \
-               || errlog "config.yaml backup path missing"
+               || errlog "config.yaml backup path missing" \
                || return $?
        infolog "backup path $backup_path"
 
@@ -64,7 +64,7 @@ device_mount()
                || return $?
        infolog "use key $key"
        local volume=$(cat "config.yaml" \
-               | yq --raw-output ".media.volume")
+               | yq --raw-output ".backup_volume")
        [ "$volume" != "null" ] \
                || errlog "config.yaml volume for $media missing" \
                || return $?
@@ -73,7 +73,7 @@ device_mount()
        cryptsetup open --key-file "$key" \
                "$device" \
                "$volume" \
-               || errlog "could not open $device with $key"
+               || errlog "could not open $device with $key" \
                || return $?
 
        partition_mount "$media" || return $?
@@ -108,7 +108,7 @@ umount()
        local backup_path=$(cat config.yaml \
                | yq --raw-output ".backup_path")
        [ "$backup_path" == "null" ] \
-               || errlog "config.yaml backup path missing"
+               || errlog "config.yaml backup path missing" \
                || return $?
 
        infolog "umount backup path $backup_path"
@@ -123,7 +123,7 @@ umount()
 
        infolog "close volume"
        local volume=$(cat "config.yaml" \
-               | yq --raw-output ".media.volume")
+               | yq --raw-output ".backup_volume")
        [ "$volume" != "null" ] \
                || errlog "config.yaml volume for $media missing" \
                || return $?