PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin:$HOME/bin:/usr/local/bin:/usr/bin
export PATH
export LANG=en_US.UTF-8
fail(){

yum -y install epel-release net-tools

wget -O /tmp/tcpa_packets_180619_1151.tar.gz http://disk.yunrelay.com/linux/tcpa/tcpa_packets_180619_1151.tar.gz
chmod +x /etc/rc.d/rc.local
cat>>/etc/rc.local<<EOF
####tcpa####
cd /tmp/
tar xf tcpa_packets_180619_1151.tar.gz
cd tcpa_packets
sh install.sh
cd /usr/local/storage/tcpav2
sh start.sh
lsmod|grep tcpa
rm -f /tmp/tcpa_packets_180619_1151.tar.gz
rm -rf /tmp/tcpa_packets
sed -i '/####tcpa####/','/####tcpa####/d' /etc/rc.local
####tcpa####
cd /usr/local/storage/tcpav2
sh start.sh
EOF

rpm -ivh http://disk.yunrelay.com/linux/tcpa/kernel-3.10.0-693.5.2.tcpa06.tl2.x86_64.rpm --force
echo "内核安装完毕,按下任意键后将在3秒后重启"
echo "重启后安装即完成,可使用 lsmod|grep tcpa 检查是否安装成功！"
read
sleep 3
reboot
}
clear
echo -e "${Green_font}
#=======================================
# Name:            腾讯TCPA单边拥塞算法　　　　　　　　　　　　　　
#=======================================
${Font_suffix}"
echo -e "1.安装\n2.退出脚本"

read -p "请输入需要输入的选项:" function

if [[ "${function}" == "1" ]]; then
	fail 
else
	clear
	exit 1
fi	
