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