#! /bin/sh



# =()<. ${NEWSCONFIG-@<NEWSCONFIG>@}>()=
. ${NEWSCONFIG-/etc/news/bin/config}



PATH=$NEWSCTL/bin:$NEWSBIN:$NEWSPATH ; export PATH
umask $NEWSUMASK

cd $NEWSCTL

touch history || exit 1
if test -s history
then
	if dbz -v history
	then
		exit 0
	fi
	echo '*** history file exists but index is not dbz format' >&2
	exit 1
fi

lock -o LOCK $$ || { echo '*** cannot get the lock file' >&2 ; exit 1 ; }
status=1
trap 'unlock LOCK ; trap 0 ; exit $status' 0 1 2 15

dbz history || exit

status=0			# and the trap does the exit
