aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2009-08-15 18:46:28 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2009-08-15 18:46:28 +0000
commit074165761ca1d0abd81fc71353748db66e60a493 (patch)
treec54f474aefcf7f102b19e5d49aa6c4760fcca7e4 /scripts
parent7a31f052e8013960cc162447397ca552ff50dfb2 (diff)
downloadsg3_utils-074165761ca1d0abd81fc71353748db66e60a493.tar.gz
sg_raw binary reads on Windows; move sas_disk_blink to sdparm
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@285 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'scripts')
-rw-r--r--scripts/README13
-rwxr-xr-xscripts/sas_disk_blink104
2 files changed, 7 insertions, 110 deletions
diff --git a/scripts/README b/scripts/README
index 00526447..3fc79a32 100644
--- a/scripts/README
+++ b/scripts/README
@@ -18,8 +18,6 @@ Details
Each script supplies more information, typically by supplying a '-h'
or '--help' option. The script source often contains explanatory
information. Following is a usage summary with a one line description:
- sas_disk_blink [-h] [-s <n>] <device>
- - blink LED on <device> using RLM bit in SAS targets
scsi_logging_level [OPTIONS]
- set Linux SCSI subsystem logging level
scsi_mandat [-h] [-L] [-q] <device>
@@ -29,7 +27,7 @@ information. Following is a usage summary with a one line description:
scsi_ready [-h] [-v] <device>+
- check the media ready status on each <device>
scsi_satl [-h] [-L] [-q] <device>
- - check <device> for SCSI to ATA Translation Layer (SATL)
+ - check <device> for SCSI to ATA Translation Layer (SATL)
scsi_start [-h] [-v] <device>+
- start media (i.e. spin up) in each <device>
scsi_stop [-h] [-v] <device>+
@@ -38,8 +36,11 @@ information. Following is a usage summary with a one line description:
- check temperature in each <device>
These scripts assume that the main sg3_utils utilities are installed
-and are on the user's PATH. The sas_disk_blink script relies on the
-sdparm utility.
+and are on the user's PATH.
+
+This directory, prior to sg3_utils-1.28, contained the sas_disk_blink
+script. Since it depends on the sdparm utility it has been moved to
+the sdparm package in its scripts directory.
Douglas Gilbert
-25th January 2007
+15th August 2009
diff --git a/scripts/sas_disk_blink b/scripts/sas_disk_blink
deleted file mode 100755
index 2cb83ca2..00000000
--- a/scripts/sas_disk_blink
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/bin/bash
-# sas_disk_blink
-#
-# Script to blink the LED on a SAS disk.
-# By default it blinks the LED for 30 seconds, thereafter leaving
-# the LED in the state it was prior to this command being called.
-# The blink is one second on, one second off, etc.
-#
-# Uses sdparm rather than sg3_utils as the former is simpler to
-# use for setting mode page value.
-#
-# Douglas Gilbert 20070317
-
-
-seconds=30
-
-usage()
-{
- echo "Usage: sas_disk_blink [-h] [-s <n>] <sas_device>"
- echo " where:"
- echo " -h, --help print usage message"
- echo " -s <n>, --set <n> where <n> is:"
- echo " 0 - set RLM to 0"
- echo " 1 - set RLM to 1"
- echo " >1 - blink LED for <n> seconds"
- echo " (default: blink for 30 seconds)"
- echo ""
- echo "Use Ready LED Meaning (RLM) mode page field to blink SAS device LED"
-}
-
-if (( $# < 1 ))
- then
- usage
- exit 1
-fi
-
-opt="$1"
-while test ! -z "$opt" -a -z "${opt##-*}"; do
- opt=${opt#-}
- case "$opt" in
- h|-help) usage ; exit 0 ;;
- s|-set) shift ; let seconds=$1 ;;
- *) echo "Unknown option: -$opt " ; exit 1 ;;
- esac
- shift
- opt="$1"
-done
-
-if ( which sdparm >/dev/null 2>&1 ) ; then
- true
-else
- echo "sdparm not found"
- sdparm
-fi
-
-if [ $seconds = "0" ]
-then
- sdparm -t sas -c RLM $1
- exit $?
-elif [ $seconds = "1" ]
-then
- sdparm -t sas -s RLM $1
- exit $?
-elif [ $seconds -gt 1 ]
-then
- outt=$(sdparm -t sas -g RLM -H $1)
- let res=$?
- if [ $res -ne 0 ]
- then
- exit $res
- fi
- if [ ${outt:0:4} = "0x00" ]
- then
- let start=0
- else
- let start=1
- fi
- echo "start blinking for $seconds seconds"
- for (( times = 1; times < $seconds; times=$times+2 )); do
- if [ $start -eq 0 ]
- then
- sdparm -q -t sas -s RLM $1
- let res=$?
- if [ $res -ne 0 ]
- then
- exit $res
- fi
- sleep 1
- sdparm -q -t sas -c RLM $1
- sleep 1
- else
- sdparm -q -t sas -c RLM $1
- let res=$?
- if [ $res -ne 0 ]
- then
- exit $res
- fi
- sleep 1
- sdparm -q -t sas -s RLM $1
- sleep 1
- fi
- done
- echo "stop blinking"
-fi