File tree Expand file tree Collapse file tree 5 files changed +53
-25
lines changed
Expand file tree Collapse file tree 5 files changed +53
-25
lines changed Original file line number Diff line number Diff line change 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
818curl https://gitee.com/gclm/one-key-linux/raw/master/include/init.sh | bash
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 33# 判断系统是否是centos和 root 用户
44main (){
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
Original file line number Diff line number Diff line change 11版本更新日志
22
3+ 2020.03.30 发布 v1.1.0
342020.03.18 发布 v1.0.0
45
You can’t perform that action at this time.
0 commit comments