Code: Alles auswählen
cat /var/log/auth.log | grep sshd | grep "Invalid user" | cut -b41-88 | cut -d' ' -f5 | sort | uniq -c > /root/.stats/ip-temp
DIFF=$(diff /root/.stats/ip /root/.stats/ip-temp)
if [ "$DIFF" = "" ]; then
echo "Keine Neuen Bruteforces! Juhu!" | mail -s "`date` - IPs -Nothing Changed-" $MAIL
else
echo $DIFF | mail -s "`date` - IPs" $MAIL
fi
cat /var/log/auth.log | grep sshd | grep "Invalid user" | cut -b41-88 | cut -d' ' -f5 | sort | uniq -c > /root/.stats/ip