Skip to content

Commit 507b632

Browse files
author
gclm
committed
feat(发布 v1.1.0 版本): 更新日志
1. 拆分init.sh 中的阿里云镜像为单独脚本 2. 优化init.sh 脚本
1 parent 7f2fd32 commit 507b632

File tree

5 files changed

+53
-25
lines changed

5 files changed

+53
-25
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33

44
## 使用教程
55

6+
### dns
7+
```shell
8+
curl https://gitee.com/gclm/one-key-linux/raw/master/include/dns.sh | bash
9+
```
10+
11+
### 阿里云yum源
12+
```shell
13+
curl https://gitee.com/gclm/one-key-linux/raw/master/include/aliyun-yum.sh | bash
14+
```
15+
616
### init
717
```shell
818
curl https://gitee.com/gclm/one-key-linux/raw/master/include/init.sh | bash

include/aliyun-yum.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
4+
main(){
5+
6+
shell_file=$(ls | grep system.sh)
7+
if [ ! -f "$shell_file" ]; then
8+
wget https://gitee.com/gclm/one-key-linux/raw/master/include/system.sh && chmod +x system.sh
9+
fi
10+
. system.sh
11+
12+
# 更新 dns
13+
curl https://gitee.com/gclm/one-key-linux/raw/master/include/dns.sh | bash
14+
15+
if [[ ${version} == "7" ]]; then
16+
# 更换镜像为阿里云镜像
17+
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
18+
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
19+
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
20+
sed -i 's#http://mirrors.cloud.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/CentOS-Base.repo
21+
sed -i 's#http://mirrors.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/CentOS-Base.repo
22+
sed -i 's#http://mirrors.cloud.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/epel-7.repo
23+
yum clean all
24+
yum makecache
25+
fi
26+
27+
rm -rf system.sh
28+
}
29+
30+
main

include/dns.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
4+
main(){
5+
# 修改DNS vi /etc/resolv.conf
6+
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
7+
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
8+
}
9+
main

include/init.sh

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,13 @@
33
# 判断系统是否是centos和 root 用户
44
main(){
55

6-
shell_file=$(ls | grep system.sh)
7-
if [ ! -f "$shell_file" ]; then
8-
wget https://gitee.com/gclm/one-key-linux/raw/master/include/system.sh && chmod +x system.sh
9-
fi
10-
. system.sh
11-
12-
yum install -y curl wget vim
13-
echo "安装 curl wget vim success"
14-
15-
# 修改DNS vi /etc/resolv.conf
16-
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
17-
echo "nameserver 114.114.114.114" >> /etc/resolv.conf
18-
19-
if [[ ${version} == "7" ]]; then
20-
# 更换镜像为阿里云镜像
21-
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
22-
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
23-
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo
24-
sed -i 's#http://mirrors.cloud.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/CentOS-Base.repo
25-
sed -i 's#http://mirrors.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/CentOS-Base.repo
26-
sed -i 's#http://mirrors.cloud.aliyuncs.com#http://mirrors.aliyun.com#g' /etc/yum.repos.d/epel-7.repo
27-
yum clean all
28-
yum makecache
29-
fi
30-
316
# 更新 yum 组件版本
327
yum -y update
338
yum -y groupinstall 'Development Tools'
349

10+
yum install -y curl wget vim
11+
echo "安装 curl wget vim success"
12+
3513
# 修改控制台
3614
curl https://gitee.com/gclm/one-key-linux/raw/master/include/update-hostname.sh | bash
3715

versions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
版本更新日志
22

3+
2020.03.30 发布 v1.1.0
34
2020.03.18 发布 v1.0.0
45

0 commit comments

Comments
 (0)