fix `cleanup` function
authorPatrick Schleizer <adrelanos@whonix.org>
Wed, 25 Oct 2023 16:02:14 +0000 (12:02 -0400)
committerPatrick Schleizer <adrelanos@whonix.org>
Thu, 7 Dec 2023 18:50:57 +0000 (13:50 -0500)
only delete `$MNTPOINT` if such a folder actually exists

grml-debootstrap

index 2124614..08e6fe2 100755 (executable)
@@ -299,8 +299,10 @@ cleanup() {
 
       # 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
       fi
     fi
   fi