#!/bin/bash
for ip in $(tail -n 200 file | sed -r 's/^.*client *(.*)#.*$/\1/' | uniq -c | awk '$1>30{print $2}' | sort | uniq)
do
iptables -I INPUT -s $ip -j DROP
for ip in $(tail -n 200 file | sed -r 's/^.*client *(.*)#.*$/\1/' | uniq -c | awk '$1>30{print $2}' | sort | uniq)
do
iptables -I INPUT -s $ip -j DROP
done
本文转自 freeterman 51CTO博客,原文链接:http://blog.51cto.com/myunix/1094908,如需转载请自行联系原作者