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

5
beadm
View File

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