X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=blobdiff_plain;f=grml-debootstrap;h=0a752e78dd648db1fb424a37d43042d67cad40c1;hp=ffcb6aa2eefe8cbe34aec3c9c85cb4013a4a60f0;hb=52e9bbf991bfa13efc940f00fd4fedbaa87f696f;hpb=2be6b799851ac001378be023d1095c7540c5d46f diff --git a/grml-debootstrap b/grml-debootstrap index ffcb6aa..0a752e7 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -205,8 +205,11 @@ cleanup() { if [ -n "$MNTPOINT" ] ; then if grep -q "$MNTPOINT" /proc/mounts ; then # make sure nothing is left inside chroot so we can unmount it - [ -x "$MNTPOINT"/etc/init.d/ssh ] && "$MNTPOINT"/etc/init.d/ssh stop - [ -x "$MNTPOINT"/etc/init.d/mdadm ] && "$MNTPOINT"/etc/init.d/mdadm stop + for service in ssh mdadm ; do + if [ -x "${MNTPOINT}/etc/init.d/${service}" ] ; then + chroot "$MNTPOINT" "/etc/init.d/${service}" stop + fi + done [ -x "$MNTPOINT"/bin/umount ] && chroot "$MNTPOINT" umount -a >/dev/null 2>&1