| ################################################ |
| # Spin down the given SCS disk(s). |
| # SCSI disks (or disks that understand SCSI commands) |
| # are assumed. By default, the immediate bit is set so the |
| # command should return immediately. The disk however will |
| # take 10 seconds or more to spin down. The '-w' option |
| # causes each stop to wait until the disk reports that it |
| # This script assumes the sg3_utils package is installed. |
| ############################################### |
| echo "Usage: scsi_stop [-h] [-v] [-w] <device>+" |
| echo " -h, --help print usage message" |
| echo " -v, --verbose more verbose output" |
| echo " -w, --wait wait for each stop to complete" |
| echo "Send SCSI START STOP UNIT command to stop each <device>" |
| while test ! -z "$opt" -a -z "${opt##-*}"; do |
| h|-help) usage ; exit 0 ;; |
| v|-verbose) verbose="-v" ;; |
| *) echo "Unknown option: -$opt " ; exit 1 ;; |
| echo "sg_start $immediate 0 $verbose $i" |
| sg_start $immediate 0 $verbose $i |