#!/bin/bash
read -p "准备部署lamp环境,所需安装包是否已准备好(yes/no):" a
if [ $a = no ];then
echo "快去准备安装包吧"
else
echo "开始安装"
read -p "你的安装包目录路径是:" b
read -p "你设定本机IP的域名是:" name
ip=`ip a | grep 'ens33' | awk "NR==2{print}" | awk -F '/' '{print$1}' | awk -F ' ' '{print$2}'`
echo "数据库用户名默认为 mysql "
read -p "设定数据库用户密码是:" c
read -p "最多支持几核同时进行编译安装:" d
echo "$ip $name" >> /etc/hosts
systemctl stop firewalld
setenforce 0
yum -y install gcc gcc-c++ make pcre pcre-devel expat-devel perl &> /dev/null
tar zxvf $b/apr-1.6.2.tar.