Only delete the temporary mountpoint directory.

This commit is contained in:
Slawomir Wojciech Wojtczak (vermaden) 2012-10-30 14:35:52 +01:00
parent a476ca72a0
commit 4025f07c3f
1 changed files with 7 additions and 2 deletions

9
beadm
View File

@ -735,9 +735,14 @@ EOF
fi
done
echo "Unmounted successfully"
if [ $( find ${MOUNTPOINT} | head | wc -l | bc ) -eq 1 ]
# only delete the temporary mountpoint directory
if echo "${MOUNTPOINT}" | grep -q "/tmp/BE-${2}." 1> /dev/null 2> /dev/null
then
rm -r ${MOUNTPOINT}
# delete only when it is an empty directory
if [ $( find ${MOUNTPOINT} | head | wc -l | bc ) -eq 1 ]
then
rm -r ${MOUNTPOINT}
fi
fi
;;