Skip to content

Commit b909ea3

Browse files
committed
更新脚本
1 parent a166822 commit b909ea3

9 files changed

Lines changed: 71 additions & 57 deletions

File tree

codes/linux/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

codes/linux/lib/install-libs.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

codes/linux/ops/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Linux 运维
2+
3+
> **本项目脚本代码用于在 [CentOS](https://www.centos.org/) 机器上安装常用命令工具或开发软件。**
4+
5+
本项目总结、收集 Linux 环境下运维常用到的脚本工具,大致分为两类:
6+
7+
- [系统运维脚本](sys)
8+
- [服务、应用运维脚本](service)

codes/linux/ops/service/svn/install-svn.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

codes/linux/ops/sys/README.md

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<!-- TOC depthFrom:2 depthTo:3 -->
66

77
- [替换 yum repo 源](#替换-yum-repo-源)
8-
- [安装基本的命令工具(可选)](#安装基本的命令工具可选)
8+
- [安装基本工具(可选)](#安装基本工具可选)
9+
- [安装常见 lib](#安装常见-lib)
910
- [关闭防火墙](#关闭防火墙)
1011
- [设置 DNS](#设置-dns)
1112
- [设置 ntp](#设置-ntp)
@@ -23,30 +24,47 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
2324
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash
2425
```
2526

26-
## 安装基本的命令工具(可选)
27+
## 安装基本工具(可选)
2728

28-
工具清单(可以根据需要,在 install-cmd-tool.sh 中把不需要的工具注掉):
29+
工具清单(可以根据需要,在 install-tools.sh 中把不需要的工具注掉):
2930

3031
```
3132
# 核心工具:df、du、chkconfig
32-
# 网络工具:ifconfig、netstat、route
33+
# 网络工具:ifconfig、netstat、route、iptables
3334
# IP工具:ip、ss、ping、tracepath、traceroute
3435
# DNS工具:dig、host、nslookup、whois
3536
# 端口工具:lsof、nc、telnet
3637
# 下载工具:curl、wget
37-
# 防火墙工具:iptables
3838
# 编辑工具:emacs、vim
3939
# 流量工具:iftop、nethogs
4040
# 抓包工具:tcpdump
4141
# 压缩工具:unzip、zip
42-
# 版本控制工具:git
42+
# 版本控制工具:git、subversion
4343
```
4444

4545
使用方法:执行以下任意命令即可执行脚本。
4646

4747
```sh
48-
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-cmd-tool.sh | bash
49-
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-cmd-tool.sh | bash
48+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash
49+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash
50+
```
51+
52+
## 安装常见 lib
53+
54+
lib 清单(可以根据需要,在 install-libs.sh 中把不需要的工具注掉):
55+
56+
```
57+
# gcc gcc-c++ kernel-devel libtool
58+
# openssl openssl-devel
59+
# zlib zlib-devel
60+
# pcre
61+
```
62+
63+
使用方法:执行以下任意命令即可执行脚本。
64+
65+
```sh
66+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash
67+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash
5068
```
5169

5270
## 关闭防火墙

codes/linux/ops/sys/init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ${filepath}/yum/change-yum-repo.sh
2020
${filepath}/config-env.sh
2121

2222
# 安装命令行工具
23-
${filepath}/install-cmd-tool.sh
23+
${filepath}/install-tools.sh
2424

2525
cat << EOF
2626
***********************************************************************************
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
###################################################################################
4+
# 安装常见 lib
5+
# Author: Zhang Peng
6+
#
7+
# 如果不知道某个命令工具是由哪个包提供的,使用 yum provides xxx
8+
# 或 yum whatprovides xxx 来查找
9+
###################################################################################
10+
11+
###################################################################################
12+
# 执行本脚本后支持的 lib 清单:
13+
# gcc gcc-c++ kernel-devel libtool
14+
# openssl openssl-devel
15+
# zlib zlib-devel
16+
# pcre
17+
###################################################################################
18+
19+
echo -e "\n>>>>>>>>> install gcc gcc-c++ kernel-devel libtool"
20+
yum -y install make gcc gcc-c++ kernel-devel libtool
21+
22+
echo -e "\n>>>>>>>>> install openssl openssl-devel"
23+
yum -y install make openssl openssl-devel
24+
25+
echo -e "\n>>>>>>>>> install zlib zlib-devel"
26+
yum -y install make zlib zlib-devel
27+
28+
echo -e "\n>>>>>>>>> install pcre"
29+
yum -y install pcre
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
###################################################################################
1010

1111
###################################################################################
12-
# 执行本脚本后支持的命令工具
12+
# 执行本脚本后支持的命令工具清单:
1313
# 核心工具:df、du、chkconfig
14-
# 网络工具:ifconfig、netstat、route
14+
# 网络工具:ifconfig、netstat、route、iptables
1515
# IP工具:ip、ss、ping、tracepath、traceroute
1616
# DNS工具:dig、host、nslookup、whois
1717
# 端口工具:lsof、nc、telnet
1818
# 下载工具:curl、wget
19-
# 防火墙工具:iptables
2019
# 编辑工具:emacs、vim
2120
# 流量工具:iftop、nethogs
2221
# 抓包工具:tcpdump
2322
# 压缩工具:unzip、zip
24-
# 版本控制工具:git
23+
# 版本控制工具:git、subversion
2524
###################################################################################
2625
# 核心工具
2726
echo -e "\n>>>>>>>>> install coreutils(df、du)"
@@ -32,6 +31,8 @@ yum install -y chkconfig
3231
# 网络工具
3332
echo -e "\n>>>>>>>>> install net-tools(ifconfig、netstat、route)"
3433
yum install -y net-tools
34+
echo -e "\n>>>>>>>>> install iptables"
35+
yum install -y iptables
3536

3637
# IP工具
3738
echo -e "\n>>>>>>>>> install iputils(ping、tracepath)"
@@ -61,10 +62,6 @@ yum install -y curl
6162
echo -e "\n>>>>>>>>> install wget"
6263
yum install -y wget
6364

64-
# 防火墙工具
65-
echo -e "\n>>>>>>>>> install iptables"
66-
yum install -y iptables
67-
6865
# 编辑工具
6966
echo -e "\n>>>>>>>>> install emacs"
7067
yum install -y emacs
@@ -88,3 +85,5 @@ yum install -y unzip
8885
# 版本控制工具
8986
echo -e "\n>>>>>>>>> install git"
9087
yum install -y git
88+
echo -e "\n>>>>>>>>> install subversion"
89+
yum install -y subversion

0 commit comments

Comments
 (0)