:
# NAME:
#	checklog - check the syslog from named
#
# DESCRIPTION:
#	This module simply reports any errors logged by named in a
#	format that allows emacs(1) to find the errors easily.
#	
# AUTHOR:
#	Simon J. Gerraty <sjg@crufty.net>

# RCSid:
#	$Id: checklog,v 1.13 2023/06/07 21:35:28 sjg Exp $
#
#	@(#) Copyright (c) 1997-2022 Simon J. Gerraty.
#
#	This file is provided in the hope that it will
#	be of use.  There is absolutely NO WARRANTY.
#	Permission to copy, redistribute or otherwise
#	use this file is hereby granted provided that 
#	the above copyright notice and this notice are
#	left intact. 
#      
#	Please send copies of changes and bug-fixes to:
#	sjg@crufty.net
#

Myname=checklog

. debug.sh

DebugOn $Myname

x=0

if test "x$NO_NAMED" = x; then
	EF=/tmp/cl$$

	. getndlog.sh
	#
	# Depending on the OS, an attempt to query a root server 
	# at dest port 0 - result of listening on a random port
	# produces an error that GetNamedErrs() will pick up.
	# In our case they are harmless so we ignore them.
	# We also don't worry about rndc issues.
	GetNamedErrs | grep -v 'sendto(.*\.0)' > $EF

	test -s $EF && { x=1; cat $EF; } || x=0
	$DEBUGGING rm -f $EF
fi
exit $x
