#! /bin/sh
# newswatch - look for anomalies, notably locks present a long time

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

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

if test $# -gt 0
then
	gurus="$*"
else
	gurus="$NEWSMASTER"
fi

cd $NEWSCTL

locks="`echo LOCK*`"
if test -r watchtime -a " $locks" != " LOCK*"
then
	trouble="`find $locks ! -newer watchtime -print`"
	if test " $trouble" != " "
	then
		ls -ldtr $trouble | mail $gurus
	fi
fi
touch watchtime
