Add reporting script

This commit is contained in:
john 2019-12-06 10:57:21 -05:00
parent bf31a2e77b
commit 0d322eb877

24
cron-rpt.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash -e
set -u
BAN2FAIL=/usr/local/bin/ban2fail
TMPFILE=/tmp/$$.cron-rpt.sh
trap "[[ -e $TMPFILE ]] && rm $TMPFILE" 0
$BAN2FAIL -a- >$TMPFILE
while read; do
MATCH=$(<$TMPFILE egrep "$REPLY\>")
[[ "$MATCH" =~ BLK ]] || continue
echo "$MATCH"
done <<\_EOF_
google\.com
outbound\.protection\.outlook\.com
mail-mail\.facebook\.com
yahoo\.com
_EOF_
exit 0