This repository has been archived by the owner on Nov 19, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathinstall.sh
69 lines (52 loc) · 2.08 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
#Install Nginx via Oneinstack(https://github.com/lj2007331/oneinstack)
cd /root
wget https://github.com/lj2007331/oneinstack/archive/V1.4.tar.gz && tar -xf V1.4.tar.gz && cd oneinstack-1.4/
#wget http://mirrors.linuxeye.com/oneinstack.tar.gz && tar -xf oneinstack.tar.gz && cd oneinstack/
#rm -rf install.sh && wget http://download.ipatrick.cn/ghost/install.sh && chmod +x install.sh
#./install.sh
# get pwd
sed -i "s@^oneinstack_dir.*@oneinstack_dir=`pwd`@" ./options.conf
. ./versions.txt
. ./options.conf
. ./include/color.sh
. ./include/check_os.sh
. ./include/check_dir.sh
. ./include/download.sh
. ./include/get_char.sh
# Check if user is root
[ $(id -u) != "0" ] && { echo "${CFAILURE}Error: You must be root to run this script${CEND}"; exit 1; }
mkdir -p $wwwroot_dir/default $wwwlogs_dir
[ -d /data ] && chmod 755 /data
# get the IP information
IPADDR=`./include/get_ipaddr.py`
PUBLIC_IPADDR=`./include/get_public_ipaddr.py`
IPADDR_COUNTRY_ISP=`./include/get_ipaddr_state.py $PUBLIC_IPADDR`
IPADDR_COUNTRY=`echo $IPADDR_COUNTRY_ISP | awk '{print $1}'`
[ "`echo $IPADDR_COUNTRY_ISP | awk '{print $2}'`"x == '1000323'x ] && IPADDR_ISP=aliyun
# check download src
. ./include/check_download.sh
checkDownload 2>&1 | tee $oneinstack_dir/install.log
# init
. ./include/memory.sh
if [ "$OS" == 'CentOS' ];then
. include/init_CentOS.sh 2>&1 | tee -a $oneinstack_dir/install.log
[ -n "`gcc --version | head -n1 | grep '4\.1\.'`" ] && export CC="gcc44" CXX="g++44"
elif [ "$OS" == 'Debian' ];then
. include/init_Debian.sh 2>&1 | tee -a $oneinstack_dir/install.log
elif [ "$OS" == 'Ubuntu' ];then
. include/init_Ubuntu.sh 2>&1 | tee -a $oneinstack_dir/install.log
fi
. include/nginx.sh
Install_Nginx 2>&1 | tee -a $oneinstack_dir/install.log
# index example
. include/demo.sh
DEMO 2>&1 | tee -a $oneinstack_dir/install.log
mkdir /usr/local/nginx/conf/vhost/
cd /root
#Clean useless things.
#rm -rf /root/oneinstack
#rm -rf /root/oneinstack.tar.gz
rm -rf /root/oneinstack-1.4
rm -rf /root/V1.4.tar.gz