#!/bin/sh

set -x

# change this if you've installed the crash files into
# a different directory

XFSPATH=/xfsstress
TIME=90

# import environment variable setup file

. $XFSPATH/SETUP

# --------------------------------

if test ! -x $XFSPATH/randsleep
then
	echo "Couldn't find $XFSPATH/randsleep."
	echo "Compile $XFSPATH/randsleep.c and try again."
fi

if test -r /stop.now
then
	echo "Stopping Now"
	exit 0
fi

echo "mount $DSK $FS"
mount $DSK $FS

echo "umount $FS"
umount $FS

date

echo "xfs_check $RDSK"
xfs_check $RDSK

if [ $? != 0 ]
then
	banner "File System Corrupted"
	exit 3
else
	banner File; banner System; banner OK
	echo "mount $DSK $FS"
	mount $DSK $FS
	$XFSPATH/runall-crash.sh $DIR &
	$XFSPATH/randsleep $TIME
	uadmin 1 1
fi
