From c568e9059c5c713604570ba8deba19eaccd76284 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 6 Oct 2018 19:57:43 -0400 Subject: [PATCH] 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. --- common | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common b/common index 65f3362..e9cecd8 100644 --- a/common +++ b/common @@ -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 }