If umount fails, use umount -f

This commit is contained in:
Renato Botelho 2016-09-27 08:21:43 -03:00
parent 406a904be3
commit 3291893538

View File

@ -673,7 +673,7 @@ create_ova_image() {
echo ">>> ERROR: Error mounting temporary vmdk image. STOPPING!" | tee -a ${LOGFILE}
print_error_pfS
fi
trap "sync; sleep 3; umount ${_mntdir}; mdconfig -d -u ${_md}; return" 1 2 15 EXIT
trap "sync; sleep 3; umount ${_mntdir} || umount -f ${_mntdir}; mdconfig -d -u ${_md}; return" 1 2 15 EXIT
echo "Done!" | tee -a ${LOGFILE}
@ -681,7 +681,7 @@ create_ova_image() {
sync
sleep 3
umount ${_mntdir} 2>&1 >>${LOGFILE}
umount ${_mntdir} || umount -f ${_mntdir} >>${LOGFILE} 2>&1
mdconfig -d -u ${_md}
trap "-" 1 2 15 EXIT