|
|
|
@ -39,7 +39,7 @@ actionstart =
|
|
|
|
|
# Values: CMD
|
|
|
|
|
#
|
|
|
|
|
actionstop = if [ -f <tmpfile>.buffer ]; then
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" <dest> <mailargs>
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" <mailargs> <dest>
|
|
|
|
|
date +%%s > <tmpfile>.lastsent
|
|
|
|
|
fi
|
|
|
|
|
rm -f <tmpfile>.buffer <tmpfile>.first
|
|
|
|
@ -80,7 +80,7 @@ actionban = TZONE=`date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'`
|
|
|
|
|
LASTREPORT=$(($NOW - `cat <tmpfile>.lastsent`))
|
|
|
|
|
LINES=$( wc -l <tmpfile>.buffer | awk '{ print $1 }' )
|
|
|
|
|
if [ $LINES -ge <lines> && $LASTREPORT -gt <minreportinterval> ] || [ $LOGAGE -gt <maxbufferage> ]; then
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ $TZONE Fail2Ban" <dest> <mailargs>
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ $TZONE Fail2Ban" <mailargs> <dest>
|
|
|
|
|
rm -f <tmpfile>.buffer <tmpfile>.first
|
|
|
|
|
echo $NOW > <tmpfile>.lastsent
|
|
|
|
|
fi
|
|
|
|
@ -95,7 +95,7 @@ actionunban = if [ -f <tmpfile>.first ]; then
|
|
|
|
|
NOW=`date +%%s`
|
|
|
|
|
LOGAGE=$(($NOW - `cat <tmpfile>.first`))
|
|
|
|
|
if [ $LOGAGE -gt <maxbufferage> ]; then
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" <dest> <mailargs>
|
|
|
|
|
cat <tmpfile>.buffer | <mailcmd> "FORMAT DSHIELD USERID <userid> TZ `date +%%z | sed 's/\([+-]..\)\(..\)/\1:\2/'` Fail2Ban" <mailargs> <dest>
|
|
|
|
|
rm -f <tmpfile>.buffer <tmpfile>.first
|
|
|
|
|
echo $NOW > <tmpfile>.lastsent
|
|
|
|
|
fi
|
|
|
|
|