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