#!/bin/sh
#
# bbchkwarnrules.cfg
#
# The MacLawran Group Inc.
# Version 1.4
# Mar 05th, 2000
#
# This program is Copyright (c) 1997-2000
# The MacLawran Group Inc.
# All Rights Reserved
#
# Check integrity of the bbwarnrules.cfg file
#

if [ ! -r bbwarnrules.cfg ]
then
	echo "Cannot read bbwarnrules.cfg"
	exit 1
fi

rc=0

cat ./bbwarnrules.cfg | grep -v "^#" | \
while read line
do
	set -f		disable globber

	line=`echo $line`
	if [ -z "$line" ]
	then
		continue
	fi


	OLDIFS=$IFS
	IFS=';'
	set $line
	IFS=$OLDIFS

	if [ "$#" -ne 7 ]
	then
		echo "invalid rule: <$line>"
		rc=2
	fi
	
	set +f		#reenable globber
done

exit $rc
