3 Star 16 Fork 13

aqztcom / cc_iptables

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
cc_nginx.sh 434 Bytes
一键复制 编辑 原始数据 按行查看 历史
ppabc 提交于 2014-10-16 13:38 . update
#!/bin/sh
##http://os.51cto.com/art/201103/249725_1.htm
nginx_home = /usr/local/nginx
log_path = /home/wwwroot/logs
/usr/bin/tail -n 50000 $log_path/access.log \
|awk ‘$8 ~/aspx/{print $2,$13}\
|grep -i -v -E “google|yahoo|baidu|msnbot|FeedSky|sogou” \
|awk ‘{print $1}’|sort|uniq -c |sort -rn \
|awk ‘{if($1>150)print “deny “$2;}’> $nginx_home/conf/vhosts/blockip.conf
/bin/kill -HUP `cat $nginx_home/nginx.pid`
Shell
1
https://gitee.com/null_564_0890/cc_iptables.git
git@gitee.com:null_564_0890/cc_iptables.git
null_564_0890
cc_iptables
cc_iptables
master

搜索帮助