From 601c99c7b3e1936e03aa16ce066ec4252c202507 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Wed, 25 Oct 2023 11:57:27 -0400 Subject: [PATCH] fix `cleanup` function only delete `$MNTPOINT` if such a folder actually exists --- grml-debootstrap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.1.4