Skip to content

Commit 15cd373

Browse files
author
gclm
committed
feat(发布 1.0.3 版本):
1. 使用centos 8 2. 解决使用过程中出现的bug
1 parent 912bb80 commit 15cd373

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

include/nginx.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,29 @@ fi
1111

1212
rm -rf /etc/yum.repos.d/nginx.repo
1313
cd /etc/yum.repos.d
14+
15+
if [[ ${version} == "8" ]]; then
1416
sudo tee /etc/yum.repos.d/nginx.repo <<-'EOF'
1517
[nginx]
1618
name=nginx repo
17-
baseurl=http://nginx.org/packages/centos/${version}/$basearch/
19+
baseurl=http://nginx.org/packages/centos/8/$basearch/
1820
gpgcheck=0
1921
enabled=1
2022
EOF
21-
yum install -y nginx
22-
echo -e "${Blue} Nginx 安装完成 ${Font}"
23+
else
24+
sudo tee /etc/yum.repos.d/nginx.repo <<-'EOF'
25+
[nginx]
26+
name=nginx repo
27+
baseurl=http://nginx.org/packages/centos/7/$basearch/
28+
gpgcheck=0
29+
enabled=1
30+
EOF
31+
fi
2332

33+
yum install -y nginx
34+
clear
35+
echo "Nginx 安装完成"
36+
nginx -v
2437
}
2538

2639
install

include/tengine-2.3.2.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,37 @@ rm -rf openssl-1.1.1d.tar.gz
1919
}
2020

2121
install_nginx(){
22+
shell_file=$(ls | grep system.sh)
23+
if [ ! -f "$shell_file" ]; then
24+
wget https://gitee.com/gclm/one-key-linux/raw/master/include/system.sh && chmod +x system.sh
25+
fi
26+
. system.sh
27+
2228
rm -rf /etc/yum.repos.d/nginx.repo
2329
cd /etc/yum.repos.d
30+
31+
if [[ ${version} == "8" ]]; then
32+
sudo tee /etc/yum.repos.d/nginx.repo <<-'EOF'
33+
[nginx]
34+
name=nginx repo
35+
baseurl=http://nginx.org/packages/centos/8/$basearch/
36+
gpgcheck=0
37+
enabled=1
38+
EOF
39+
else
2440
sudo tee /etc/yum.repos.d/nginx.repo <<-'EOF'
2541
[nginx]
2642
name=nginx repo
2743
baseurl=http://nginx.org/packages/centos/7/$basearch/
2844
gpgcheck=0
2945
enabled=1
3046
EOF
47+
fi
48+
3149
yum install -y nginx
32-
echo -e "${Blue} Nginx 安装完成 ${Font}"
50+
clear
51+
echo "Nginx 安装完成"
52+
nginx -v
3353
}
3454

3555
install_tengine(){
@@ -65,6 +85,7 @@ echo "=====================================\
6585
暂停服务: systemctl stop nginx.service
6686
=====================================
6787
"
88+
nginx -v
6889
}
6990

7091
main

0 commit comments

Comments
 (0)