其他一键安装脚本
This commit is contained in:
28
nginx-yum-install/nginx-yum-install.sh
Normal file
28
nginx-yum-install/nginx-yum-install.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
# '\033[字背景颜色;字体颜色m字符串\033[0m'
|
||||
GREENCOLOR='\033[1;32m'
|
||||
NC='\033[0m'
|
||||
|
||||
DOWNLOAD_DIR="/usr/src"
|
||||
SOURCE_DIR="http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm"
|
||||
|
||||
echo "===================================================="
|
||||
printf "${GREENCOLOR} Nginx's install begin ${NC} \n"
|
||||
echo "===================================================="
|
||||
|
||||
# 安装 Nginx
|
||||
# 进入目录
|
||||
cd $DOWNLOAD_DIR
|
||||
# 下载 Nginx 包
|
||||
wget $SOURCE_DIR
|
||||
# 安装 Nginx 的 yum 源
|
||||
rpm -ivh nginx-release-centos-7-0.el7.ngx.noarch.rpm
|
||||
# 安装 Nginx
|
||||
yum -y install nginx
|
||||
# 启动 Nginx
|
||||
service nginx restart
|
||||
|
||||
echo "===================================================="
|
||||
printf "${GREENCOLOR} Nginx's install finish ${NC} \n"
|
||||
echo "===================================================="
|
Reference in New Issue
Block a user