From 5425be46d70bbe4bc1a20c476a91ee3572220aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=B3=E6=9D=BE?= Date: Mon, 15 Aug 2016 19:25:01 +0800 Subject: [PATCH] fix bug --- lemp.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lemp.sh b/lemp.sh index 71af006..51f7475 100644 --- a/lemp.sh +++ b/lemp.sh @@ -10,14 +10,16 @@ if [ -n "`grep 'Aliyun Linux release' /etc/issue`" -o -e /etc/redhat-release ];t [ -n "`grep ' 6\.' /etc/redhat-release`" -o -n "`grep 'Aliyun Linux release6 15' /etc/issue`" ] && CentOS_RHEL_version=6 fi -if ["$OS" == 'CentOS'] || ["$CentOS_RHEL_version" != 6] || ["$CentOS_RHEL_version" != 7];then +if [ "$OS" != 'CentOS' ] || [ "$CentOS_RHEL_version" != '6' -a "$CentOS_RHEL_version" != '7' ];then echo "${CFAILURE}Error: This script only support CentOS 6 & CentOS 7${CEND}"; - exit 1; + kill -9 $$ fi if [ `getconf WORD_BIT` == 32 ] && [ `getconf LONG_BIT` == 64 ];then + BIT=64 +else echo "${CFAILURE}Error: This script only support 64 bit CentOS${CEND}"; - exit 1; + kill -9 $$ fi # Init @@ -27,19 +29,19 @@ sudo yum -y install vim wget epel-release unzip # Install the Required Repositories echo "Installing the Required Repositories..." -sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm +sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-${CentOS_RHEL_version}.rpm echo "[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/ gpgcheck=0 -enabled=1" >> /etc/yum.repos.d/nginx.repo +enabled=1" > /etc/yum.repos.d/nginx.repo echo "[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos\$releasever-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB -gpgcheck=1" >> /etc/yum.repos.d/mariadb.repo +gpgcheck=1" > /etc/yum.repos.d/mariadb.repo # Install MariaDB echo "Installing MariaDB..." @@ -86,7 +88,7 @@ sudo service nginx restart # Set Up Autostart echo "Setting Autostart..." -if ["$CentOS_RHEL_version" == 6];then +if [ "$CentOS_RHEL_version" == 6 ];then sudo chkconfig --levels 235 mysql on sudo chkconfig --levels 235 nginx on sudo chkconfig --levels 235 php-fpm on