fix bug
This commit is contained in:
16
lemp.sh
16
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
|
[ -n "`grep ' 6\.' /etc/redhat-release`" -o -n "`grep 'Aliyun Linux release6 15' /etc/issue`" ] && CentOS_RHEL_version=6
|
||||||
fi
|
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}";
|
echo "${CFAILURE}Error: This script only support CentOS 6 & CentOS 7${CEND}";
|
||||||
exit 1;
|
kill -9 $$
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ `getconf WORD_BIT` == 32 ] && [ `getconf LONG_BIT` == 64 ];then
|
if [ `getconf WORD_BIT` == 32 ] && [ `getconf LONG_BIT` == 64 ];then
|
||||||
|
BIT=64
|
||||||
|
else
|
||||||
echo "${CFAILURE}Error: This script only support 64 bit CentOS${CEND}";
|
echo "${CFAILURE}Error: This script only support 64 bit CentOS${CEND}";
|
||||||
exit 1;
|
kill -9 $$
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Init
|
# Init
|
||||||
@@ -27,19 +29,19 @@ sudo yum -y install vim wget epel-release unzip
|
|||||||
|
|
||||||
# Install the Required Repositories
|
# Install the Required Repositories
|
||||||
echo "Installing 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]
|
echo "[nginx]
|
||||||
name=nginx repo
|
name=nginx repo
|
||||||
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
|
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
enabled=1" >> /etc/yum.repos.d/nginx.repo
|
enabled=1" > /etc/yum.repos.d/nginx.repo
|
||||||
|
|
||||||
echo "[mariadb]
|
echo "[mariadb]
|
||||||
name = MariaDB
|
name = MariaDB
|
||||||
baseurl = http://yum.mariadb.org/10.1/centos\$releasever-amd64
|
baseurl = http://yum.mariadb.org/10.1/centos\$releasever-amd64
|
||||||
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
|
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
|
# Install MariaDB
|
||||||
echo "Installing MariaDB..."
|
echo "Installing MariaDB..."
|
||||||
@@ -86,7 +88,7 @@ sudo service nginx restart
|
|||||||
# Set Up Autostart
|
# Set Up Autostart
|
||||||
echo "Setting 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 mysql on
|
||||||
sudo chkconfig --levels 235 nginx on
|
sudo chkconfig --levels 235 nginx on
|
||||||
sudo chkconfig --levels 235 php-fpm on
|
sudo chkconfig --levels 235 php-fpm on
|
||||||
|
|||||||
Reference in New Issue
Block a user