common: avoid calling umount without any args

For example, when calling arch-chroot on a dir without a /proc:

  # arch-chroot badroot
  mount: badroot/proc: mount point does not exist.
  ==> ERROR: failed to setup chroot badroot
  umount: bad usage
  Try 'umount --help' for more information.
This commit is contained in:
Dave Reisner 2018-10-06 19:57:43 -04:00
parent 0c7d9e570f
commit c568e9059c

4
common
View File

@ -91,7 +91,9 @@ chroot_setup() {
}
chroot_teardown() {
umount "${CHROOT_ACTIVE_MOUNTS[@]}"
if (( ${#CHROOT_ACTIVE_MOUNTS[@]} )); then
umount "${CHROOT_ACTIVE_MOUNTS[@]}"
fi
unset CHROOT_ACTIVE_MOUNTS
}