diff options
author | Joerg Wunsch <joerg@FreeBSD.org> | 1997-03-02 11:21:07 +0000 |
---|---|---|
committer | Joerg Wunsch <joerg@FreeBSD.org> | 1997-03-02 11:21:07 +0000 |
commit | 06996f8920c524490a8482aeb889cf7662477c19 (patch) | |
tree | 5667233dc1e8777aab5e6f57cf1451999bc43beb /sbin | |
parent | a896f0256ce87722ad17a12c78240978ec21e668 (diff) | |
download | src-06996f8920c524490a8482aeb889cf7662477c19.tar.gz src-06996f8920c524490a8482aeb889cf7662477c19.zip |
Avoid the ``Three seconds until format begins'' construct. It's
inconsistent with the remaining unix utilities, so replace it by
something better suited.
Learned from: The Unix Hater's Handbook :-)
Notes
Notes:
svn path=/head/; revision=23255
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/scsiformat/scsiformat.8 | 11 | ||||
-rw-r--r-- | sbin/scsiformat/scsiformat.sh | 27 |
2 files changed, 23 insertions, 15 deletions
diff --git a/sbin/scsiformat/scsiformat.8 b/sbin/scsiformat/scsiformat.8 index d0f18c150ab4..ba15f65e492f 100644 --- a/sbin/scsiformat/scsiformat.8 +++ b/sbin/scsiformat/scsiformat.8 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" @(#)scsiformat.8 5.1 (Berkeley) 6/5/93 -.\" $Id$ +.\" $Id: scsiformat.8,v 1.7 1997/02/22 14:33:17 peter Exp $ .\" .Dd June 5, 1993 .Dt SCSIFORMAT 8 @@ -40,7 +40,7 @@ .Nd format SCSI disks and show SCSI parameters .Sh SYNOPSIS .Nm scsiformat -.Op Fl qw +.Op Fl qyw .Op Fl p Ar page-control .Ar device-name .Sh DESCRIPTION @@ -81,6 +81,13 @@ shows which parameters are variable. Quiet; suppress the mode page output. Only the inquiry string will be printed, so the operator can ensure he's going to format the intended drive. +.It Fl y +Yes; do format without asking any question. If this option is not +provided, +.Nm scsiformat +will ask back before actually starting to format the device. At this +point, hitting the interrupt key (normally Control-C) will abort the +program. .It Fl w Do actually format; by default, only the disk parameters will be displayed. diff --git a/sbin/scsiformat/scsiformat.sh b/sbin/scsiformat/scsiformat.sh index 3518e29ce61e..803925581eda 100644 --- a/sbin/scsiformat/scsiformat.sh +++ b/sbin/scsiformat/scsiformat.sh @@ -26,30 +26,32 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# $Id$ -# -# scsiformat [-qw] [-p page-control] raw-device-name +# $Id: scsiformat.sh,v 1.4 1997/02/22 14:33:17 peter Exp $ # PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH READONLY=yes +DOIT=no QUIET=no RAW= PAGE=0 usage() { - echo "usage: scsiformat [-qw] [-p page-control] raw-device-name" 1>&2 + echo "usage: scsiformat [-qyw] [-p page-control] raw-device-name" 1>&2 exit 2 } -while getopts "qwp:" option +while getopts "qwyp:" option do case $option in q) QUIET=yes ;; + y) + DOIT=yes + ;; w) READONLY=no ;; @@ -130,14 +132,13 @@ fi # !quiet if [ "$READONLY" = "no" ] then - # grace period, last chance to hit INTR - echo -n "Three seconds until format begins." - sleep 1 - echo -n "." - sleep 1 - echo -n "." - sleep 1 + if [ "$DOIT" != "yes" ] + then + echo "This will destroy all data on this drive!" + echo -n "Hit return to continue, or INTR (^C) to abort: " + read dummy + fi # formatting may take a huge amount of time, set timeout to 2 hours - echo " Formatting... this may take a while." + echo "Formatting... this may take a while." scsi -s 7200 -f $RAW -c "4 0 0 0 0 0" fi |