diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2009-10-15 18:00:18 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2009-10-15 18:00:18 +0000 |
commit | 6e562c357c7977d77c65724114437d46fed9ccbd (patch) | |
tree | 9e4bebfc150b5e2a5dcdbff53c0a3c4c452cc721 /scripts | |
parent | 80fe7030675e598db00002a40359723023360d9f (diff) | |
download | sg3_utils-6e562c357c7977d77c65724114437d46fed9ccbd.tar.gz |
sync to spc4r22; fix block device characteristics VPD page form factor field
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@320 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/scsi_mandat | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/scripts/scsi_mandat b/scripts/scsi_mandat index 85d989c5..b0cbcea7 100755 --- a/scripts/scsi_mandat +++ b/scripts/scsi_mandat @@ -17,11 +17,12 @@ # This script uses utilities frim sg3_utils package (version # 1.21 or later) and sdparm (version 0.99 or later) # -# Douglas Gilbert 20070317 +# Douglas Gilbert 20091005 log=0 quiet=0 +verbose="" file_err=0 inv_opcode=0 @@ -44,6 +45,7 @@ usage() echo " where: -h print usage message" echo " -L, --log append stderr to 'scsi_mandat.err'" echo " -q suppress some output" + echo " -v increase verbosity of output" echo "" echo "Check <device> for manadatory SCSI command support" } @@ -64,6 +66,9 @@ while test ! -z "$opt" -a -z "${opt##-*}"; do h|-help) usage ; exit 0 ;; L|-log) let log=$log+1 ;; q|-quiet) let quiet=$quiet+1 ;; + v|-verbose) verbose="-v" ;; + vv) verbose="-vv" ;; + vvv) verbose="-vvv" ;; *) echo "Unknown option: -$opt " ; exit 1 ;; esac shift @@ -74,14 +79,24 @@ for command in "sg_inq" "sg_luns" "sg_turs" "sg_requests" "sg_vpd" \ "sg_vpd -i" "sg_senddiag -t" do if [ $quiet -eq 0 ] - then echo "$command" $1 + then echo "$command" $verbose $1 fi - if [ $log -eq 0 ] + if [ $verbose ] then - $command $1 > /dev/null 2>> /dev/null + if [ $log -eq 0 ] + then + $command $verbose $1 + else + $command $verbose $1 >> scsi_mandat.err 2>> scsi_mandat.err + fi else - $command $1 > /dev/null 2>> scsi_mandat.err + if [ $log -eq 0 ] + then + $command $1 > /dev/null 2>> /dev/null + else + $command $1 > /dev/null 2>> scsi_mandat.err + fi fi res=$? case "$res" in |