various
parent
3181e9564f
commit
2402a4b42d
|
@ -304,15 +304,18 @@ elif [[ "$1" == "rescue" ]]; then
|
|||
--target "/srv/dumps/$host/restic/$snapshot" \
|
||||
"$snapshot"
|
||||
elif [[ "$1" == "toggle-mount" ]]; then
|
||||
mkdir -p "$restic_mount_path"
|
||||
test_restic_mount="$(mountpoint "$restic_mount_path")"
|
||||
function test_restic_mount() {
|
||||
mountpoint "$restic_mount_path" &>/dev/null
|
||||
echo $?
|
||||
}
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
mkdir -p "$restic_mount_path"
|
||||
|
||||
if [[ $(test_restic_mount) == 0 ]]; then
|
||||
say info "Unmounting: $restic_mount_path"
|
||||
umount "$restic_mount_path"
|
||||
|
||||
if [[ $? == 0 ]]; then
|
||||
say warning "Deleting: $restic_mount_path"
|
||||
rm -rf "$restic_mount_path"
|
||||
else
|
||||
die "Failed to umount (are you still in '$restic_mount_path'?)"
|
||||
|
|
Loading…
Reference in New Issue