#!/bin/sh

#
# Display SMTP connections from hosts that were booted by hnbl along with
# a starting and ending timestamp and count.
#
# Any script args are passed thru to count.pl
#

MYFILE=/service/qpsmtpd/log/main/current

grep 'hnbl plugin: rejected' $MYFILE  |  awk '{print $8}' | count.pl "$@"

head -1 $MYFILE | tai64nlocal | awk '{print $1 " " $2}'
tail -1 $MYFILE | tai64nlocal | awk '{print $1 " " $2}'

