2
0
Fork 0

sh.zio.backup: add messages and extra error handling for toggle-mount

main
Ducky 2023-08-22 21:53:56 +01:00
parent e9c55702e6
commit 030030e546
1 changed files with 10 additions and 2 deletions

View File

@ -307,10 +307,18 @@ elif [[ "$1" == "toggle-mount" ]]; then
test_restic_mount="$(mountpoint "$restic_mount_path")" test_restic_mount="$(mountpoint "$restic_mount_path")"
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
say info "Unmounting: $restic_mount_path"
umount "$restic_mount_path" umount "$restic_mount_path"
rm -rf "$restic_mount_path"
if [[ $? == 0 ]]; then
say warn "Deleting: $restic_mount_path"
rm -rf "$restic_mount_path"
else
die "Failed to umount (are you still in '$restic_mount_path'?)"
fi
else else
mkdir -fp "$restic_mount_path" say info "Mounting: $restic_mount_path"
mkdir -p "$restic_mount_path"
invoke_restic mount "$restic_mount_path" &>/dev/null & disown; invoke_restic mount "$restic_mount_path" &>/dev/null & disown;
fi fi
else else