#***************************************************************************** 
# Copyright(C) 1996, 1997 Network Flight Recorder, Inc.
# All rights reserved.
#
#  Use and distribution of this software and its source code
#  are governed by the terms and conditions of the
#  Network Flight Recorder Software License ("LICENSE.TXT") 
#
#  File:   cleandata
#  Author: Kent Landfield <kent@nfr.net>
# 
#****************************************************************************/ 

NFRDATADIR=/nfr/nfr/install/data
INDEXDIR=$NFRDATADIR/index

case $# in
	0) echo "usage: $0 package/recorder"; exit 1;;
	1) backend=$1;;
	*);;
esac

bail=0

if [ ! -f $INDEXDIR/$backend/index ]; then
	echo "$INDEXDIR/$backend/index missing"
	bail=1
fi

if [ ! -d $NFRDATADIR/$backend ]; then
	echo "$NFRDATADIR/$backend missing"
	bail=1
fi

if [ $bail -eq 1 ]; then
	echo "$1: quiting..."
	exit 0
fi

rm -f $INDEXDIR/$backend/index
rm -rf $NFRDATADIR/$backend
