2002-11-09 05:49:41 +00:00
|
|
|
##/bin/sh
|
2009-06-05 15:41:14 -05:00
|
|
|
#
|
|
|
|
|
# Copyright (c) 2002-2004 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License as
|
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it would be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
#
|
2002-11-09 05:49:41 +00:00
|
|
|
|
2004-06-29 02:16:00 +00:00
|
|
|
#check bonnie is installed
|
|
|
|
|
if [ "`whereis bonnie++`" == "bonnie++:"]; then
|
|
|
|
|
echo $0 error bonnie not installed.
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
|
2002-11-09 05:49:41 +00:00
|
|
|
run_bonnie()
|
|
|
|
|
{
|
|
|
|
|
# dir, no hostname, quiet, fast (no per-char), ram (no sz checks)
|
|
|
|
|
tmp=/var/tmp
|
|
|
|
|
|
|
|
|
|
mkdir ./bonnie || exit 1
|
|
|
|
|
defaults="-d ./bonnie -q -f -r 0"
|
2003-05-14 05:25:31 +00:00
|
|
|
defaults="$defaults -u "`id -u`" -g "`id -g`
|
2003-09-09 01:50:09 +00:00
|
|
|
bonnie++ -m '' $defaults $@ >$tmp/$$.bonnie.stdout 2>$tmp/$$.bonnie.stderr
|
2002-11-09 05:49:41 +00:00
|
|
|
status=$?
|
|
|
|
|
rm -fr ./bonnie
|
|
|
|
|
[ $status -ne 0 ] && exit 1
|
2003-09-09 01:50:09 +00:00
|
|
|
filter_stdout < $tmp/$$.bonnie.stdout
|
|
|
|
|
filter_stderr < $tmp/$$.bonnie.stderr 1>&2
|
2003-09-22 00:26:33 +00:00
|
|
|
rm -f $tmp/$$.bonnie.stdout $tmp/$$.bonnie.stderr
|
2002-11-09 05:49:41 +00:00
|
|
|
exit 0
|
|
|
|
|
}
|