#!/bin/sh
# DESCRIPTION: Remon errors and log file clean-up

if [ ! "$RDLOCALHOME" ]; then
	echo ERROR: RDLOCALHOME is not set.
	exit 1;
fi

if [ ! -d $RDLOCALHOME/tmp ]; then
	echo ERROR: No directory $RDLOCALHOME/tmp.
	exit 1;
fi

cd $RDLOCALHOME/tmp

FILES=`ls rd*"`

for file in $FILES
do
	ls -l $file
	echo "_REMON_START_OF_FILE_"
	cat $file
	echo "_REMON_END_OF_FILE_"
	/bin/rm $file
done
