From fc72119f67614152d635452856ec9894474599e4 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Mon, 3 Jan 2022 17:49:24 +0000 Subject: [PATCH] rescan-scsi-bus.sh: apply fix for '-r' from https://github.com/doug-gilbert/sg3_utils/pull/10/ from Nitin U. Yewale, broken by rev 867 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@929 6180dd3e-e324-4e3e-922d-17de1ae2f315 Conflict: only keep rescan-scsi-bus's changes, change of following files are removed: BSD_LICENSE CREDITS ChangeLog debian/changelog doc/rescan-scsi-bus.sh.8 doc/sg3_utils.8 sg3_utils.spec --- scripts/rescan-scsi-bus.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh index 16a7642..57fbe66 100755 --- a/scripts/rescan-scsi-bus.sh +++ b/scripts/rescan-scsi-bus.sh @@ -307,7 +307,13 @@ testonline () IPREV=$(echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/') STR=$(printf " Vendor: %-08s Model: %-16s Rev: %-4s" "$IVEND" "$IPROD" "$IPREV") IPTYPE=$(echo "$INQ" | sed -n 's/.* Device_type=\([0-9]*\) .*/\1/p') + if [ -z "$IPTYPE" ]; then + IPTYPE=$(echo "$INQ" | sed -n 's/.* PDT=\([0-9]*\) .*/\1/p') + fi IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) Device.*/\1/p') + if [ -z "$IPQUAL" ] ; then + IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) PDT.*/\1/p') + fi if [ "$IPQUAL" != 0 ] ; then [ -z "$IPQUAL" ] && IPQUAL=3 [ -z "$IPTYPE" ] && IPTYPE=31 -- 2.34.1