更新脚本

This commit is contained in:
Zhang Peng 2019-05-07 12:07:59 +08:00
parent 00c93dbb2d
commit ff2e5b8798
7 changed files with 34 additions and 13 deletions

View File

@ -19,7 +19,7 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux
说明: 说明:
- 脚本会下载解压 maven3 到 `/opt/maven` 路径下。 - 脚本会下载解压 maven `3.6.0``/opt/maven` 路径下。
- 备份并替换 `settings.xml`,使用 aliyun 镜像加速 maven。 - 备份并替换 `settings.xml`,使用 aliyun 镜像加速 maven。
使用方法: 使用方法:
@ -31,12 +31,26 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash
``` ```
## Node.js 安装
说明:
脚本会先安装 nvmnodejs 版本管理器),并通过 nvm 安装 nodejs `10.15.2`
使用方法:
执行以下任意命令即可执行安装脚本。
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
```
## Redis 安装 ## Redis 安装
说明: 说明:
下载 `5.0.4` 版本的 redis 并解压安装到 `/opt/redis` 路径下。 下载 redis `5.0.4` 并解压安装到 `/opt/redis` 路径下。
使用方法: 使用方法:

View File

@ -1,15 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF cat << EOF
################################################################################### ###################################################################################
# 安装 JDK8 脚本 # 安装 JDK8 脚本
# 仅适用于所有 CentOS 发行版本 # 仅适用于所有 CentOS 发行版本
# JDK 会被安装到 /usr/lib/jvm/java 路径。 # JDK 会被安装到 /usr/lib/jvm/java 路径。
# Author: Zhang Peng # Author: Zhang Peng
################################################################################### ###################################################################################
EOF EOF
echo -e "\n>>>>>>>>> install jdk8" echo -e "\n>>>>>>>>> install jdk8"
yum -y install java-1.8.0-openjdk.x86_64 yum -y install java-1.8.0-openjdk.x86_64
yum -y install java-1.8.0-openjdk-devel.x86_64 yum -y install java-1.8.0-openjdk-devel.x86_64
java -version

View File

@ -18,6 +18,7 @@ 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/service/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 ;;
"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/service/redis-install.sh | bash ;;
*) *)
echo -e "输入项不支持!" echo -e "输入项不支持!"

View File

@ -39,3 +39,5 @@ source /etc/profile
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/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml
mvn -v

View File

@ -1,26 +1,32 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF
################################################################################### ###################################################################################
# 安装 Nodejs 脚本 # 安装 Nodejs 脚本
# 适用于所有 linux 发行版本。 # 适用于所有 linux 发行版本。
# Author: Zhang Peng # Author: Zhang Peng
################################################################################### ###################################################################################
echo -e "\n>>>>>>>>> install node.js" EOF
version=10.15.2
if [[ -n $1 ]]; then
version=$1
fi
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
nvm --version nvm --version
execode=$? execode=$?
if [[ ${execode} != 0 ]]; then if [[ ${execode} != 0 ]]; then
echo -e "\n未找到 nvm ,开始安装"
echo -e "\n>>>>>>>>> install nvm" echo -e "\n>>>>>>>>> install nvm"
rm -rf ~/.nvm rm -rf ~/.nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
. ~/.nvm/nvm.sh . ~/.nvm/nvm.sh
nvm --version nvm --version
fi fi
version=8.9.4 echo -e "\n>>>>>>>>> install nodejs by nvm"
nvm install ${version} nvm install ${version}
nvm use ${version} nvm use ${version}
node --version node --version

View File

@ -1,7 +0,0 @@
# 安装 Nodejs
使用方法:
```sh
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs/install-nodejs.sh | bash
```

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
cat << EOF cat << EOF
################################################################################### ###################################################################################
# 安装 Redis 脚本 # 安装 Redis 脚本
# Author: Zhang Peng # Author: Zhang Peng
################################################################################### ###################################################################################
EOF EOF
version=5.0.4 version=5.0.4