Skip to content

Commit

Permalink
fix cleanup function
Browse files Browse the repository at this point in the history
only delete `$MNTPOINT` if such a folder actually exists
  • Loading branch information
adrelanos committed Dec 7, 2023
1 parent 601c99c commit d2be7fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions grml-debootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2be7fb

Please sign in to comment.