1
1
mirror of https://github.com/jrbrtsn/ban2fail synced 2024-06-16 11:58:01 +00:00
ban2fail/ban2fail-cron.sh
2019-11-27 22:06:49 -05:00

27 lines
490 B
Bash
Executable File

#!/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
# 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