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