log ufw errors to log file

This commit is contained in:
sceox 2020-09-06 11:26:45 -07:00
parent 4312d75e27
commit 49d1f7524d

View File

@ -19,7 +19,7 @@ if ! grep -q '<appears>yes</appears>' $repl; then
fi
freq=`grep '<frequency>' $repl | sed 's/<frequency>//; s!</frequency>!!'`
if [ "$freq" -ge 1 ]; then
if ufw deny from $ip >/dev/null; then
if ufw deny from $ip >/dev/null 2>>$logf; then
echo `date` blocked ip $ip with freq $freq >> $logf
rm $repl
exit 0