diff options
Diffstat (limited to 'examples/sg_persist_tst.sh')
-rwxr-xr-x | examples/sg_persist_tst.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/sg_persist_tst.sh b/examples/sg_persist_tst.sh index 95a09a82..f0cd4d38 100755 --- a/examples/sg_persist_tst.sh +++ b/examples/sg_persist_tst.sh @@ -2,6 +2,8 @@ # This script is meant as an example of using the sg_persist utility # in the sg3_utils package. This script works as expected on the # author's Fujitsu MAM3184 and a Seagate ST373455 disk. +# +# Version 1.5 20070314 # N.B. make sure the device name is correct for your environment. @@ -13,6 +15,30 @@ if [ ! -n "$1" ];then exit 1 fi +echo ">>> try to report capabilities:" +sg_persist -c $1 +res=$? +case "$res" in + 0) ;; + 1) echo " syntax error" ;; + 2) echo " not ready" ;; + 3) echo " medium error" ;; + 5) echo " illegal request, report capabilities not supported?" ;; + 6) echo " unit attention" ;; + 9) echo " illegal request, Persistent Reserve (In) not supported" ;; + 11) echo " aborted command" ;; + 15) echo " file error with $1 " ;; + 20) echo " no sense" ;; + 21) echo " recovered error" ;; + 33) echo " timeout" ;; + 97) echo " response fails sanity" ;; + 98) echo " other SCSI error" ;; + 99) echo " other error" ;; + *) echo " unknown exit status for sg_persist: $res" ;; +esac +echo "" +sleep 1 + echo ">>> check if any keys are registered:" sg_persist -k $1 sleep 1 |