更新脚本

This commit is contained in:
Zhang Peng 2019-05-07 14:14:30 +08:00
parent dc457efa80
commit 92384cead4
4 changed files with 37 additions and 28 deletions

View File

@ -1,6 +1,6 @@
# 服务安装配置 # 服务安装配置
## JDK 安装 ## JDK8 安装
说明: 说明:
@ -11,11 +11,11 @@ JDK8 会被安装到 `/usr/lib/jvm/java` 路径。
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash
``` ```
## Maven 安装 ## Maven 安装配置
说明: 说明:
@ -57,8 +57,20 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux
执行以下任意命令即可执行安装脚本。 执行以下任意命令即可执行安装脚本。
```sh ```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash
``` ```
## Tomcat8 安装
说明:
下载 tomcat `8.5.28` 并解压安装到 `/opt/tomcat` 路径下。
使用方法:
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash
```

View File

@ -16,10 +16,10 @@ do
path=$(cd "$(dirname "$0")"; pwd) path=$(cd "$(dirname "$0")"; pwd)
case ${item} in case ${item} in
"git") yum install -y git ;; "git") yum install -y git ;;
"jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash ;; "jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/jdk8-install.sh | bash ;;
"maven") wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;; "maven") wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;;
"nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;; "nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;;
"redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash ;; "redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/redis-install.sh | bash ;;
*) *)
echo -e "输入项不支持!" echo -e "输入项不支持!"
main main

View File

@ -1,15 +0,0 @@
# 安装 Tomcat
## 安装 Tomcat8
使用方法:
```sh
wget --no-check-certificate --no-cookies https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat/install-tomcat8.sh
chmod -R 777 install-tomcat8.sh
./install-tomcat8.sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat/install-tomcat8.sh | bash
```
脚本会下载解压 tomcat 到 `/opt/tomcat` 路径下。

View File

@ -1,16 +1,28 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF
################################################################################### ###################################################################################
# 安装 Tomcat 脚本 # 安装 Tomcat 脚本
# 适用于所有 linux 发行版本。 # 适用于所有 linux 发行版本。
# Author: Zhang Peng # Author: Zhang Peng
################################################################################### ###################################################################################
echo -e "\n>>>>>>>>> install tomcat" EOF
# 下载并解压 redis
root=/opt/tomcat
version=8.5.28 version=8.5.28
if [[ -n $1 ]]; then
version=$1
fi
root=/opt/tomcat
if [[ -n $2 ]]; then
root=$2
fi
echo -e "\n>>>>>>>>> download tomcat"
mkdir -p ${root} mkdir -p ${root}
wget -O ${root}/apache-tomcat-${version}.tar.gz https://archive.apache.org/dist/tomcat/tomcat-8/v${version}/bin/apache-tomcat-${version}.tar.gz wget -O ${root}/apache-tomcat-${version}.tar.gz https://archive.apache.org/dist/tomcat/tomcat-8/v${version}/bin/apache-tomcat-${version}.tar.gz
tar zxvf apache-tomcat-${version}.tar.gz
echo -e "\n>>>>>>>>> install tomcat"
tar zxvf ${root}/apache-tomcat-${version}.tar.gz -C ${root}