fix double umount issue where multiple repos have the same datapath

This commit is contained in:
Rob Pearce 2020-11-08 00:24:35 +11:00
parent cc291b2ea4
commit a8e4f54266
1 changed files with 11 additions and 9 deletions

20
bare.sh
View File

@ -389,15 +389,17 @@ function do_mount() {
}
function do_umount() {
if [[ $USEUSMB -eq 1 ]]; then
log "Unmounting usmb volume '$USMBNAME'"
usmb -u $USMBNAME
elif [[ $USENFS -eq 1 ]]; then
log "Unmounting nfs volume '$NFSPATH' from $DATAPATH"
umount $DATAPATH
elif [[ $USELOCALMOUNT -eq 1 ]]; then
log "Unmounting dir $DATAPATH"
umount $DATAPATH
if is_mounted $DATAPATH; then
if [[ $USEUSMB -eq 1 ]]; then
log "Unmounting usmb volume '$USMBNAME'"
usmb -u $USMBNAME
elif [[ $USENFS -eq 1 ]]; then
log "Unmounting nfs volume '$NFSPATH' from $DATAPATH"
umount $DATAPATH
elif [[ $USELOCALMOUNT -eq 1 ]]; then
log "Unmounting dir $DATAPATH"
umount $DATAPATH
fi
fi
}