From: Patrick Schleizer Date: Wed, 25 Oct 2023 16:02:14 +0000 (-0400) Subject: fix `cleanup` function X-Git-Tag: v0.106~7^2~20 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=d2be7fb21bfd1c28199ddc1959dfd3e15149acc8 fix `cleanup` function only delete `$MNTPOINT` if such a folder actually exists --- diff --git a/grml-debootstrap b/grml-debootstrap index 2124614..08e6fe2 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -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