Commit a25e68c8 authored by Jelle van der Waa's avatar Jelle van der Waa 🚧
Browse files

borg: handle umount error when not mounted

When nothing is mounted, umount will error out failing the backup, so
handle this case.
parent ce001199
......@@ -26,7 +26,9 @@ if is_btrfs "$src"; then
list_of_btrfs_submounts=$(findmnt -Rl -o target,fstype,options / | grep btrfs | grep -v "subvol=\/[[:alnum:]]" | cut -d ' ' -f1)
if [[ -d "$backup_mountdir" ]]; then
umount -R "$backup_mountdir"
if [[ $(findmnt -M "$backup_mountdir") ]]; then
umount -R "$backup_mountdir"
fi
rmdir "$backup_mountdir"
fi
mkdir "$backup_mountdir"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment