#!/bin/bash
##########################
#created by AL  2018/04/27
##########################
#nginx and crontab to view connect
###############################


##install nginx

yum install -y gcc gcc-c++  nginx wget

mkdir /opt/web
cd /opt/web
wget http://47.90.101.26/linux/sh/node_install/web.conf
cp -f web.conf  /etc/nginx/conf.d/default.conf

chkconfig --add nginx
chkconfig --level 345 nginx on 
/etc/init.d/nginx  start

##get sh
mkdir /root/sh
cd /root/sh
wget http://47.90.101.26/linux/sh/get_connect.sh

chmod +x *.sh

##add cron
connect_stats=`cat /etc/crontab |grep get_connect |grep -v grep |wc -l `

if [ $connect_stats == 0 ];then 
echo "* * * * *  root  /root/sh/get_connect.sh">> /etc/crontab

fi


wget http://47.90.101.26/linux/haproxy/install_haproxy.sh
chmod +x install_haproxy.sh
./install_haproxy.sh

