[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#440439: Updated patch



On Tue, Feb 26, 2008 at 05:03:04PM +0100, Frans Pop wrote:
> This line is way to cryptic to my taste:
>         [ -n "$(/sbin/multipath -l)" && $? ] && return 0 || return 1
> 
> Could you rewrite that to something that is a bit more intuitive?

This one is simpler and much more robust against weird multipath -l
output. O.k. to apply?
 -- Guido

diff --git a/packages/hw-detect/disk-detect.sh b/packages/hw-detect/disk-detect.sh
index efe55b0..3290832 100755
--- a/packages/hw-detect/disk-detect.sh
+++ b/packages/hw-detect/disk-detect.sh
@@ -102,7 +102,12 @@ defaults {
 EOF
 	fi
 	log-output -t disk-detect /sbin/multipath -v$MP_VERBOSE
-	[ -n "$(/sbin/multipath -l)" && $? ] && return 0 || return 1
+
+	if multipath -l 2>/dev/null | grep -q '^mpath[0-9]\+ '; then
+		return 0
+	else
+		return 1
+	fi
 }
 
 hw-detect disk-detect/detect_progress_title || true
-- 
1.5.4.2




Reply to: