#!/bin/sh
# @(#) $Header: bihourly,v 1.1 96/11/07 17:39:23 leres Exp $ (LBL)
#
#  bihourly arpwatch job
#
# This script is based on the bihourly cron script from
# arpwatch-2.1a13 and modified by Craig Sanders <cas@taz.net.au>. It
# also contains all additional modifications previously shipped in
# debian/patches/05debian_fhs, debian/patches/22secure_tempfile, and
# debian/patches/31_bug321504_errs-bihourly.

PATH=$PATH:/usr/local/sbin
export PATH
#
cd /var/lib/arpwatch
#
list=`cat list`
cname=`cat cname`
errs=`tempfile -p arpbh -s .tmp`
#
alist=""
for r in $list; do \
	arpfetch $r $cname > $r 2> $errs
	if test -s $errs; then
		echo "arpfetch $r failed:"
		sed -e 's/^/    /' $errs
		continue
	fi
	alist="$alist $r"
done
#
rm -f $errs
arpsnmp $alist
#
exit 0
