# Remove temporary mountpoint again
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
if [ -d "$MNTPOINT" ] ; then
# Remove temporary mountpoint again
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
if [ -d "$MNTPOINT" ] ; then
# remove directory only if we used the default with process id inside the name
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
# remove directory only if we used the default with process id inside the name
if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
- einfo "Removing directory ${MNTPOINT}"
- rmdir "$MNTPOINT" || eend $?
+ if test -d "$MNTPOINT" ; then
+ einfo "Removing directory ${MNTPOINT}"
+ rmdir "$MNTPOINT" || eend $?
+ fi