#!/bin/sh
#   diskformat.sh

# default index number is 1, range is 0 to N.
num=1
# take the index number as a command line parameter, if present.
if [ $# -gt 0 ]
then
   num=$1
fi
echo "args=$# num=$num"

# Do a SCSI Diagnostic self-test on this hard disk
sgdiag -i $num -a 

echo "Ready to format Disk $num, press Ctrl-C if not OK"
read ans

# Do a SCSI low-level format on the 2nd device in the list (num=1) 
sgdiag -i $num -f 

