变更路径

This commit is contained in:
Zhang Peng 2019-05-10 11:25:59 +08:00
parent a786dd2b37
commit 02ea38a10a
74 changed files with 65 additions and 65 deletions

View File

@ -19,7 +19,7 @@
| [Svn 安装](docs/linux/soft/svn.md) | Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。 | | [Svn 安装](docs/linux/soft/svn.md) | Svn 是 Subversion 的简称,是一个开放源代码的版本控制系统,它采用了分支管理系统。 |
| [Tomcat 安装](docs/linux/soft/tomcat.md) | Java 应用服务器 | | [Tomcat 安装](docs/linux/soft/tomcat.md) | Java 应用服务器 |
| [Zookeeper 安装](docs/linux/soft/zookeeper.md) | 分布式系统协调软件 | | [Zookeeper 安装](docs/linux/soft/zookeeper.md) | 分布式系统协调软件 |
| [Nacos 安装](linux/soft/nacos.md) | 微服务发现、管理 | | [Nacos 安装](docs/linux/soft/nacos.md) | 微服务发现、管理 |
## :memo: 知识点 ## :memo: 知识点

View File

@ -7,7 +7,7 @@
1下载脚本 1下载脚本
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/download.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/download.sh | bash
``` ```
2执行脚本 2执行脚本
@ -20,7 +20,7 @@ cd /tmp/dunwu-ops
3清除脚本 3清除脚本
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/clear.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/clear.sh | bash
``` ```
本项目总结、收集 Linux 环境下运维常用到的脚本工具,大致分为三类: 本项目总结、收集 Linux 环境下运维常用到的脚本工具,大致分为三类:

View File

@ -4,9 +4,9 @@ path=/tmp/dunwu-ops
mkdir -p ${path} mkdir -p ${path}
printf "\n>>>>>>>>> download scripts to ${path}" printf "\n>>>>>>>>> download scripts to ${path}"
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/dunwu-ops.sh -O ${path}/dunwu-ops.sh wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-ops.sh -O ${path}/dunwu-ops.sh
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/dunwu-soft.sh -O ${path}/dunwu-soft.sh wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-soft.sh -O ${path}/dunwu-soft.sh
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/dunwu-sys.sh -O ${path}/dunwu-sys.sh wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/dunwu-sys.sh -O ${path}/dunwu-sys.sh
chmod +x ${path}/dunwu-ops.sh chmod +x ${path}/dunwu-ops.sh
chmod +x ${path}/dunwu-soft.sh chmod +x ${path}/dunwu-soft.sh

View File

@ -33,7 +33,7 @@ if [[ -n $index ]]; then
exit -1 exit -1
fi fi
key=${menus[$no]} key=${menus[$no]}
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/${key}-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/${key}-install.sh | bash
else else
echo "输入项不支持!" echo "输入项不支持!"
exit -1 exit -1

View File

@ -16,22 +16,22 @@ select item in ${menus[@]}
do do
case ${item} in case ${item} in
"替换yum镜像") "替换yum镜像")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/change-yum-repo.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/change-yum-repo.sh | bash
main ;; main ;;
"安装基本的命令工具") "安装基本的命令工具")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
main ;; main ;;
"安装常用libs") "安装常用libs")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
main ;; main ;;
"系统配置") "系统配置")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/sys-settings.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/sys-settings.sh | bash
main ;; main ;;
"全部执行") "全部执行")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/change-yum-repo.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/change-yum-repo.sh | bash
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools | bash
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/sys-settings.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/sys-settings.sh | bash
printf "执行完毕,退出。\n" ;; printf "执行完毕,退出。\n" ;;
"退出") "退出")
exit 0 ;; exit 0 ;;

View File

@ -11,8 +11,8 @@
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zsh-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zsh-install.sh | bash
``` ```
## JDK8 安装 ## JDK8 安装
@ -26,8 +26,8 @@ JDK8 会被安装到 `/usr/lib/jvm/java` 路径。
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/jdk8-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/jdk8-install.sh | bash
``` ```
## Maven 安装配置 ## Maven 安装配置
@ -42,8 +42,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/maven-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/maven-install.sh | bash
``` ```
## Node.js 安装 ## Node.js 安装
@ -57,8 +57,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nodejs-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nodejs-install.sh | bash
``` ```
## MongoDB 安装 ## MongoDB 安装
@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/mongodb-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/mongodb-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/mongodb-install.sh | bash
``` ```
## Redis 安装配置 ## Redis 安装配置
@ -89,15 +89,15 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
执行以下任意命令即可按照默认配置安装脚本。 执行以下任意命令即可按照默认配置安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh | bash
``` ```
定制化配置 定制化配置
```sh ```sh
# 下载脚本到本地 # 下载脚本到本地
wget https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/redis-install.sh wget https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/redis-install.sh
chmod +x redis-install.sh chmod +x redis-install.sh
./redis-install.sh 5.0.4 /opt/redis 6379 123456 ./redis-install.sh 5.0.4 /opt/redis 6379 123456
``` ```
@ -118,8 +118,8 @@ chmod +x redis-install.sh
使用方法: 使用方法:
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/tomcat8-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/tomcat8-install.sh | bash
``` ```
## Kafka 安装 ## Kafka 安装
@ -131,8 +131,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/kafka-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/kafka-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/kafka-install.sh | bash
``` ```
## RocketMQ 安装 ## RocketMQ 安装
@ -144,8 +144,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/rocketmq-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/rocketmq-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/rocketmq-install.sh | bash
``` ```
## Nacos 安装 ## Nacos 安装
@ -157,8 +157,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nacos-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nacos-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nacos-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nacos-install.sh | bash
``` ```
## ZooKeeper 安装 ## ZooKeeper 安装
@ -170,7 +170,7 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zookeeper-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/zookeeper-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/zookeeper-install.sh | bash
``` ```

View File

@ -76,7 +76,7 @@ replaceLogstashConfig() {
sed -i "s/# http.host: \"127.0.0.1\"/ http.host: ${IP}/g" ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/config/logstash.yml sed -i "s/# http.host: \"127.0.0.1\"/ http.host: ${IP}/g" ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/config/logstash.yml
touch ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin/nohup.out touch ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin/nohup.out
cd ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin cd ${ELASTIC_SOFTWARE_PATH}/logstash-${version}/bin
wget "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/elk/config/logstash.conf" wget "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/elk/config/logstash.conf"
} }
# 替换 Kibana 配置 # 替换 Kibana 配置
@ -125,6 +125,6 @@ replaceFilebeatConfig
# 最后,将启动脚本下载到本地 # 最后,将启动脚本下载到本地
mkdir -p /home/zp/script mkdir -p /home/zp/script
wget -P /home/zp/script "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/elk/boot-elk.sh" wget -P /home/zp/script "https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/elk/boot-elk.sh"
#setPrivilegeForUser #setPrivilegeForUser

View File

@ -47,6 +47,6 @@ source /etc/profile
# 备份并替换 settings.xml使用 aliyun 镜像加速 maven # 备份并替换 settings.xml使用 aliyun 镜像加速 maven
echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml" echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml"
cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml
mvn -v mvn -v

View File

@ -5,7 +5,7 @@
使用方法: 使用方法:
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nginx/install-nginx.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nginx/install-nginx.sh | bash
``` ```
脚本会下载解压 nginx 到 `/opt/nginx` 路径下。 脚本会下载解压 nginx 到 `/opt/nginx` 路径下。
@ -15,6 +15,6 @@ curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/lin
使用方法: 使用方法:
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/nginx/install-nginx-by-yum.sh | bash
``` ```

View File

@ -54,7 +54,7 @@ cd -
echo -e "\n>>>>>>>>> config redis" echo -e "\n>>>>>>>>> config redis"
cp ${path}/redis.conf ${path}/redis.conf.default cp ${path}/redis.conf ${path}/redis.conf.default
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/soft/config/redis-remote-access.conf -O ${path}/redis.conf wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/soft/config/redis-remote-access.conf -O ${path}/redis.conf
cp ${path}/redis.conf /etc/redis/${port}.conf cp ${path}/redis.conf /etc/redis/${port}.conf
sed -i "s/^port 6379/port ${port}/g" /etc/redis/${port}.conf sed -i "s/^port 6379/port ${port}/g" /etc/redis/${port}.conf
sed -i "s/^requirepass 123456/requirepass ${password}/g" /etc/redis/${port}.conf sed -i "s/^requirepass 123456/requirepass ${password}/g" /etc/redis/${port}.conf

View File

@ -20,8 +20,8 @@
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/change-yum-repo.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/change-yum-repo.sh | bash
``` ```
## 安装基本工具(可选) ## 安装基本工具(可选)
@ -45,8 +45,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-tools.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-tools.sh | bash
``` ```
## 安装常见 lib ## 安装常见 lib
@ -63,8 +63,8 @@ lib 清单(可以根据需要,在 install-libs.sh 中把不需要的工具
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/install-libs.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/install-libs.sh | bash
``` ```
## 关闭防火墙 ## 关闭防火墙
@ -72,8 +72,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
``` ```
## 设置 DNS ## 设置 DNS
@ -81,8 +81,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
``` ```
## 设置 ntp ## 设置 ntp
@ -90,6 +90,6 @@ wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/li
使用方法:执行以下任意命令即可执行脚本。 使用方法:执行以下任意命令即可执行脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
``` ```

View File

@ -23,7 +23,7 @@ cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
# 根据发型版本选择相应 yum 镜像 # 根据发型版本选择相应 yum 镜像
if [[ ${version} == 5 ]]; then if [[ ${version} == 5 ]]; then
# Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢 # Cento5 已废弃,只能使用 http://vault.CentOS.org/ 替换,但由于是国外镜像,速度较慢
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-5.repo -O /etc/yum.repos.d/CentOS-Base.repo
# 根据实际发型版本情况替换 # 根据实际发型版本情况替换
detailVersion=`lsb_release -r | awk '{print substr($2,1,3)}'` detailVersion=`lsb_release -r | awk '{print substr($2,1,3)}'`
@ -32,9 +32,9 @@ if [[ ${version} == 5 ]]; then
# 不替换下面的开关可能会出现错误Could not open/read repomd.xml # 不替换下面的开关可能会出现错误Could not open/read repomd.xml
sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/CentOS-Media.repo
elif [[ ${version} == 6 ]]; then elif [[ ${version} == 6 ]]; then
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo
elif [[ ${version} == 7 ]]; then elif [[ ${version} == 7 ]]; then
wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo wget -N https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/yum/Centos-7.repo -O /etc/yum.repos.d/CentOS-Base.repo
else else
echo -e "版本不支持,替换 yum repo 失败" echo -e "版本不支持,替换 yum repo 失败"
fi fi

View File

@ -96,13 +96,13 @@ do
case ${ITEM} in case ${ITEM} in
"设置 DNS") "设置 DNS")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
;; ;;
"设置 NTP") "设置 NTP")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
;; ;;
"关闭防火墙") "关闭防火墙")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
;; ;;
"配置 IPv4") "配置 IPv4")
configIpv4 configIpv4
@ -111,9 +111,9 @@ case ${ITEM} in
closeIpv6 closeIpv6
;; ;;
"全部执行") "全部执行")
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-dns.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-dns.sh | bash
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/set-ntp.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/set-ntp.sh | bash
curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/ops/sys/stop-firewall.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/linux-tutorial/master/codes/linux/sys/stop-firewall.sh | bash
configIpv4 configIpv4
closeIpv6 closeIpv6
;; ;;