From: Michael Prokop Date: Tue, 5 Jun 2007 12:05:02 +0000 (+0200) Subject: Some more umount checks X-Git-Tag: 0.10~3 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=cba387c584bdf456daae4d60a7213c0153cb3f84;hp=1bbb415e599ec0be1c188584f779bf40f3c13ad7 Some more umount checks --- diff --git a/grml-debootstrap b/grml-debootstrap index 990566f..cbd131a 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Die Jun 05 14:02:22 CEST 2007 [mika] +# Latest change: Die Jun 05 14:04:47 CEST 2007 [mika] ################################################################################ # http://www.debian.org/releases/stable/i386/index.html.en @@ -96,7 +96,7 @@ while [ "$#" -gt "0" ] ; do ;; -i|--iso) shift - [ -n "$MIRROR" ] && unset MIRROR + [ -n "$MIRROR" ] && unset MIRROR ISO=$1 ;; -h|--help) @@ -386,14 +386,18 @@ grub_install() { # unmount $MNTPOINRT {{{ umount_chroot() { if [ -n "$ISODIR" ] ; then - einfo "Unmount $MNTPOINT/$ISODIR" - umount "$MNTPOINT/$ISODIR" - eend $? + if grep -q "$ISODIR" /proc/mounts ; then + einfo "Unmount $MNTPOINT/$ISODIR" + umount "$MNTPOINT/$ISODIR" + eend $? + fi fi - if [ -n "$PARTITION" ] ; then - einfo "Unmount $MNTPOINT" - umount $MNTPOINT - eend $? + if grep -q "$PARTITION" /proc/mounts ; then + if [ -n "$PARTITION" ] ; then + einfo "Unmount $MNTPOINT" + umount $MNTPOINT + eend $? + fi fi } # }}}