aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-01-03 17:49:24 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-01-03 17:49:24 +0000
commitfc72119f67614152d635452856ec9894474599e4 (patch)
treeda19b5b2ab82ee09f357a72006ae92d50c9498e2 /scripts
parenta4e181c479918a5697a1826960265706049dd929 (diff)
downloadsg3_utils-fc72119f67614152d635452856ec9894474599e4.tar.gz
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/rescan-scsi-bus.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 46fe6c06..23eff3b0 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -1,10 +1,10 @@
#!/bin/bash
# Script to rescan SCSI bus, using the scsi add-single-device mechanism.
# (c) 1998--2010 Kurt Garloff <kurt@garloff.de>, GNU GPL v2 or v3
-# (c) 2006--2018 Hannes Reinecke, GNU GPL v2 or later
+# (c) 2006--2022 Hannes Reinecke, GNU GPL v2 or later
# $Id: rescan-scsi-bus.sh,v 1.57 2012/03/31 14:08:48 garloff Exp $
-VERSION="20180615"
+VERSION="20220103"
SCAN_WILD_CARD=4294967295
setcolor ()
@@ -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