sh.zio.backup: add messages and extra error handling for toggle-mount
parent
e9c55702e6
commit
030030e546
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue