Skip to content

Commit ff2e5b8

Browse files
committed
更新脚本
1 parent 00c93db commit ff2e5b8

7 files changed

Lines changed: 34 additions & 13 deletions

File tree

codes/linux/ops/soft/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux
1919

2020
说明:
2121

22-
- 脚本会下载解压 maven3`/opt/maven` 路径下。
22+
- 脚本会下载解压 maven `3.6.0``/opt/maven` 路径下。
2323
- 备份并替换 `settings.xml`,使用 aliyun 镜像加速 maven。
2424

2525
使用方法:
@@ -31,12 +31,26 @@ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/
3131
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash
3232
```
3333

34+
## Node.js 安装
35+
36+
说明:
37+
38+
脚本会先安装 nvm(nodejs 版本管理器),并通过 nvm 安装 nodejs `10.15.2`
39+
40+
使用方法:
41+
42+
执行以下任意命令即可执行安装脚本。
43+
44+
```sh
45+
curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
46+
wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash
47+
```
3448

3549
## Redis 安装
3650

3751
说明:
3852

39-
下载 `5.0.4` 版本的 redis 并解压安装到 `/opt/redis` 路径下。
53+
下载 redis `5.0.4` 并解压安装到 `/opt/redis` 路径下。
4054

4155
使用方法:
4256

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/usr/bin/env bash
22

33
cat << EOF
4+
45
###################################################################################
56
# 安装 JDK8 脚本
67
# 仅适用于所有 CentOS 发行版本
78
# JDK 会被安装到 /usr/lib/jvm/java 路径。
89
# Author: Zhang Peng
910
###################################################################################
11+
1012
EOF
1113

1214
echo -e "\n>>>>>>>>> install jdk8"
1315

1416
yum -y install java-1.8.0-openjdk.x86_64
1517
yum -y install java-1.8.0-openjdk-devel.x86_64
18+
java -version

codes/linux/ops/soft/main.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ case ${item} in
1818
"git") yum install -y git ;;
1919
"jdk") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash ;;
2020
"maven") wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;;
21+
"nodejs") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/nodejs-install.sh | bash ;;
2122
"redis") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash ;;
2223
*)
2324
echo -e "输入项不支持!"

codes/linux/ops/soft/maven-install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ source /etc/profile
3939
echo -e "\n>>>>>>>>> replace ${path}/conf/settings.xml"
4040
cp ${path}/conf/settings.xml ${path}/conf/settings.xml.bak
4141
wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path}/conf/settings.xml
42+
43+
mvn -v
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
#!/usr/bin/env bash
22

3+
cat << EOF
4+
35
###################################################################################
46
# 安装 Nodejs 脚本
57
# 适用于所有 linux 发行版本。
68
# Author: Zhang Peng
79
###################################################################################
810
9-
echo -e "\n>>>>>>>>> install node.js"
11+
EOF
12+
13+
version=10.15.2
14+
if [[ -n $1 ]]; then
15+
version=$1
16+
fi
1017

1118
. ~/.nvm/nvm.sh
1219
nvm --version
1320
execode=$?
1421
if [[ ${execode} != 0 ]]; then
15-
echo -e "\n未找到 nvm ,开始安装"
1622
echo -e "\n>>>>>>>>> install nvm"
1723
rm -rf ~/.nvm
18-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
24+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
1925
. ~/.nvm/nvm.sh
2026
nvm --version
2127
fi
2228

23-
version=8.9.4
29+
echo -e "\n>>>>>>>>> install nodejs by nvm"
2430
nvm install ${version}
2531
nvm use ${version}
2632
node --version

codes/linux/ops/soft/nodejs/README.md

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

codes/linux/ops/soft/redis-install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#!/usr/bin/env bash
22

33
cat << EOF
4+
45
###################################################################################
56
# 安装 Redis 脚本
67
# Author: Zhang Peng
78
###################################################################################
9+
810
EOF
911

1012
version=5.0.4

0 commit comments

Comments
 (0)