fix `cleanup` function
[grml-debootstrap.git] / grml-debootstrap
index cff0116..2124614 100755 (executable)
@@ -257,7 +257,9 @@ cleanup() {
 
   # Remove temporary mountpoint again
   if echo "$MNTPOINT" | grep -q '/mnt/debootstrap\.' ; then
-    rmdir "$MNTPOINT" 2>/dev/null
+    if [ -d "$MNTPOINT" ] ; then
+      rmdir "$MNTPOINT" 2>/dev/null
+    fi
   fi
 
   # make sure $TARGET is not mounted when exiting grml-debootstrap