scripts
This is an old revision of the document!
#! /bin/sh for ip in echo `grep -i unban /var/log/fail2ban.log | awk '{print $NF}'` do for email in `whois $ip | perl -wne'while(/[\w\.\-]+@[\w\.\-]+\w+/g){print "$&\n"}' | sort | uniq` do echo "Sending email to $email ..." echo "Hi, The IP $ip has just been banned. Here are more information about $ip: `whois $ip` Regards," | mail -s "$ip banned" $email; done done
scripts.1363005684.txt.gz · Last modified: 2013/03/11 13:41 by cedric