#!/bin/bash mysql -h172.20.101.59 -uroot -pxxxx -e "select * from huiyewang.snto_session;"|awk -F"|" ‘{print $1}‘|awk ‘{print $3}‘|awk ‘{++S[$NF]}END{for(a in S) print a,S[a]}‘|awk ‘$2 >100 {print $1,$2}‘ >> /data/list/backlist.txt
#!/bin/bash ip=$(cat /data/list/backlist.txt|awk ‘{print $1}‘|sort|uniq) for a in $ip do iptables -I INPUT -p tcp -s $a -j DROP service iptables save done service iptables restart
时间: 2024-10-06 23:30:30