X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=d9d3202301319136ea2ee3ff21fe7f20fb8697c6;hp=990566ff7d9554ccfe4b9f5cd3d1cf23dd9cdf6f;hb=049beca624626061dc7943ad9a2c2d8c7778ba5d;hpb=1bbb415e599ec0be1c188584f779bf40f3c13ad7 diff --git a/grml-debootstrap b/grml-debootstrap index 990566f..d9d3202 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:23:38 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) @@ -169,6 +169,7 @@ case $ISO in ;; esac ISODIR=${ISO##file:} +ISODIR=${ISODIR%%/} # provide variables to chroot system touch /etc/debootstrap/variables @@ -386,14 +387,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 "$MNTPOINT" /proc/mounts ; then + if [ -n "$PARTITION" ] ; then + einfo "Unmount $MNTPOINT" + umount $MNTPOINT + eend $? + fi fi } # }}}