#!/bin/sh
#   configure disks for S5000 SCSI
#
# Use -w option from scsirastools-1.5.5
#
# wcache: 0=disable, 1=enable
wcache=0
logfile=$DeploymentStore/cfgdisk.log
ADDLOG=addLogRecord
# ADDLOG=echo

date >$logfile

queryProperty Disk device - type=SCSI >/dev/null
if [ $? -eq 255 ]
then
   # No SCSI disks, so exit with error
   $ADDLOG CFGDISK ERROR "No SCSI disk devices found"
   exit 1
fi
# set disk write cache on all disks
sgmode -a -w$wcache  >>$logfile 2>&1
ret=$?
if [ $ret -eq 0 ]
then
 $ADDLOG CFGDISK INFO "Success: sgmode completed"
else
 $ADDLOG CFGDISK ERROR "Error $ret: sgmode failed"
fi
# Note: leaves behind *.mdf files

echo "cfgdisk(wc=$wcache) returned $ret"
exit $ret
