From d033692df18c1ba6385b20871e8fe5fa5a1e3514 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 4 Mar 2012 22:51:15 -0500 Subject: functions: check for length before using array This avoids passing an empty array to umount Signed-off-by: Dave Reisner --- functions | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'functions') diff --git a/functions b/functions index 833711b..a3c2660 100644 --- a/functions +++ b/functions @@ -505,7 +505,9 @@ umount_all() { mounts=("$target" "${mounts[@]}") done < <(findmnt -mrunRo TARGET,FSTYPE,OPTIONS /) - umount -r "${mounts[@]}" + if (( ${#mounts[*]} )); then + umount -r "${mounts[@]}" + fi } -- cgit v1.2.3