Shell脚本一键部署LAMP
Shell代码 #!/bin/sh #检查一下liunx系统 if grep -Eqii "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then DISTRO='CentOS' fi version=$(/usr/bin/lsb_release -a |grep Description |awk -F : '{print $2}' |sed 's/^[ \t]*//g'|sed -r 's/.* ([0-9]+[.][0-9]+)\..*/\1/') if [ $DISTRO != CentOS ] || [ "${version}" != 7.4 ];then echo "========================该脚本只适合 Linux Centos7.4 ================================="; exit 1 fi #检测安装环境 if [ $UID -ne 0 ];then echo "========================请以超级管理员身份运行该脚本================================="; exit 1 fi if [ ! `rpm -qa yum` ];then echo "===========================