#!/bin/bash
#
#---------------------------------------------------------------------------------------
#Scripname:killip,baSEOnip_conntrack,writebywwy.
#---------------------------------------------------------------------------------------
######################################
##----------------Tomakeaindex.html-----------------------##
######################################
echo"<b>IfthetotalIPs>2500<fontcolor=/"#ff0000/">(total$wcat$date)</font>ANDif:</b>">/var/www/html/wwy/drop/index.html
echo"<p>youconnect<b>/">100/"</b>,youipwillbekilledin<b>30min</b>.</p>">>/var/www/html/wwy/drop/index.html
echo"<p>youconnect<b>/"50-100/"</b>,youipwillbekilledin<b>15min</b>.</p>">>/var/www/html/wwy/drop/index.html
echo"<p>youconnect<b>/"30-50/"</b>,youipwillbekilledin<b>10min</b>.</p>">>/var/www/html/wwy/drop/index.html
echo"<hrcolor=/"#ff8000/">">>/var/www/html/wwy/drop/index.html
echo"<p><b><fontcolor=/"#ff0000/">TheseIPs(total$wcblackip3 $wcblackip2 $wcblackip1)werekilled,at<fontsize=5>$date</font></font><ahref=../all>(look-upallIPs)</a></b></p>">>/var/www/html/wwy/drop/index.html
awk'{$1}{if($1>=100)print$1,$2}'/tmp/tmp11.txt|sort-nr|awk'{print"<p>""<fontcolor=/"#ff0000/">"$1"</font>""/t","<b>"$2"</b>""/t""kill30min""</p>"}'>>/var/www/html/wwy/drop/index.html
awk'{$1}{if($1>=50&&$1<100)print$1,$2}'/tmp/tmp11.txt|sort-nr|awk'{print"<p>"$1"/t","<b>"$2"</b>""/t""kill15min""</p>"}'>>/var/www/html/wwy/drop/index.html
awk'{$1}{if($1>30&&$1<50)print$1,$2}'/tmp/tmp11.txt|sort-nr|awk'{print"<p>"$1"/t","<b>"$2"</b>""/t""kill10min""</p>"}'>>/var/www/html/wwy/drop/index.html
echo"<p><b>Youcan/"ctrl F/"tofindyourip'sconnects.(total$wcIPsat$date)</b></p>">/var/www/html/wwy/all/index.html
echo"<p><ahref=../drop><--back</a></p>">>/var/www/html/wwy/all/index.html
cat/tmp/tmp11.txt|sort-nr|awk'{print"<p>"$1"/t",$2"/t""</p>"}'>>/var/www/html/wwy/all/index.html
#####################################
##-----------------UseiptablestoDROP---------------------##
#####################################
make_clr
if[-s/tmp/tmp33-3.txt];then
kill30m/tmp/tmp33-3-clr.txt/tmp/tmp33-3.txt&
sleep1s
fi
if[-s/tmp/tmp33-2.txt];then
kill15m/tmp/tmp33-2-clr.txt/tmp/tmp33-2.txt&
sleep1s
fi
if[-s/tmp/tmp33-1.txt];then
kill10m/tmp/tmp33-1-clr.txt/tmp/tmp33-1.txt&
sleep1s
fi
#-------------------------------
elif["$date2"-lt5]&&["$date2"-gt3]
then
whilereadclrall;do
clr_conns$clrall
done</tmp/tmp111.txt
echo"clrat$date">>/tmp/killip/tmp.log.txt
fi
#####################################
##-------------------makesystemlog------------------------##
#####################################
if[!-e/tmp/killip/tmp.log.txt];then
mkdir/tmp/killip
touch/tmp/killip/tmp.log.txt
fi
echo"$wc$date$cpu$cpu2$wcblackip3 $wcblackip2 $wcblackip1">>/tmp/killip/tmp.log.txt
新聞熱點
疑難解答