1
1
mirror of https://github.com/jrbrtsn/ban2fail synced 2024-06-26 00:38:01 +00:00
ban2fail/ban2fail-cron.sh

27 lines
490 B
Bash
Raw Normal View History

#!/bin/bash -e
#
# JDR Wed 27 Nov 2019 08:16:00 PM EST
# The purpose of this script is to be run from a periodic
# cron job to send summary via email.
#
BAN2FAIL=/usr/local/bin/ban2fail
TRIES=
for (( TRIES= 0; TRIES < 10; ++TRIES )); do
2019-11-28 03:06:49 +00:00
# cron generates an entry in auth.log when it runs, which means
# ban2fail.sh will launch ban2fail because of the new log entry.
# Solution is to pause for a second before running ban2fail here.
sleep 1
$BAN2FAIL -s && break
done
exit 0