File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,10 +11,27 @@ JDK8 会被安装到 `/usr/lib/jvm/java` 路径。
1111执行以下任意命令即可执行安装脚本。
1212
1313``` sh
14- curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft /jdk8-install.sh | bash
15- wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft /jdk8-install.sh | bash
14+ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service /jdk8-install.sh | bash
15+ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service /jdk8-install.sh | bash
1616```
1717
18+ ## Maven 安装
19+
20+ 说明:
21+
22+ - 脚本会下载解压 maven3 到 ` /opt/maven ` 路径下。
23+ - 备份并替换 ` settings.xml ` ,使用 aliyun 镜像加速 maven。
24+
25+ 使用方法:
26+
27+ 执行以下任意命令即可执行安装脚本。
28+
29+ ``` sh
30+ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash
31+ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash
32+ ```
33+
34+
1835## Redis 安装
1936
2037说明:
@@ -26,8 +43,8 @@ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux
2643执行以下任意命令即可执行安装脚本。
2744
2845``` sh
29- curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft /redis-install.sh | bash
30- wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft /redis-install.sh | bash
46+ curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service /redis-install.sh | bash
47+ wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service /redis-install.sh | bash
3148```
3249
3350
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3- # 打印头部信息
4- printHeadInfo () {
53cat << EOF
64
75***********************************************************************************
8- * 欢迎使用 Linux CentOS 服务安装配置脚本
6+ * 欢迎使用 Linux CentOS 软件安装配置脚本
97* Author: Zhang Peng
108***********************************************************************************
119
1210EOF
13- }
1411
15- main () {
12+ path= $( cd " $( dirname " $0 " ) " ; pwd )
1613PS3=" Please select script type: "
1714select item in " git" " jdk" " maven"
1815do
1916path=$( cd " $( dirname " $0 " ) " ; pwd)
2017case ${item} in
2118 " git" ) yum install -y git ;;
22- " jdk" ) ${path} /jdk/install-jdk8.sh ;;
23- " maven" ) ${path} /maven/install-maven3.sh ;;
19+ " jdk" ) curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/jdk8-install.sh | bash ;;
20+ " maven" ) wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/maven-install.sh | bash ;;
21+ " redis" ) curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/service/redis-install.sh | bash ;;
2422 * )
2523 echo -e " 输入项不支持!"
2624 main
2725 ;;
2826esac
2927break
3028done
31- }
32-
33- filepath=$( cd " $( dirname " $0 " ) " ; pwd)
34-
35- # ####################################### MAIN ########################################
36- path=$( cd " $( dirname " $0 " ) " ; pwd)
3729
38- printHeadInfo
39- main
Original file line number Diff line number Diff line change 2222
2323echo -e " \n>>>>>>>>> download maven"
2424mkdir -p ${root}
25- cd ${root}
26-
27- wget --no-check-certificate --no-cookies --header " Cookie: oraclelicense=accept-securebackup-cookie" -O ${root} /apache-maven-${version} -bin.tar.gz http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${version} /binaries/apache-maven-${version} -bin.tar.gz
25+ wget --no-check-certificate --no-cookies --header " Cookie: oraclelicense=accept-securebackup-cookie" -O ${root} /apache-maven-${version} -bin.tar.gz http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/${version} /binaries/apache-maven-${version} -bin.tar.gz
2826
2927echo -e " \n>>>>>>>>> install maven"
30- tar -zxvf apache-maven-${version} -bin.tar.gz -C ${root}
28+ tar -zxvf ${root} / apache-maven-${version} -bin.tar.gz -C ${root}
3129
30+ path=${root} /apache-maven-${version}
3231# 设置环境变量
3332cat >> /etc/profile << EOF
34- export MAVEN_HOME=/opt/maven/apache-maven-3.5.4
33+ export MAVEN_HOME=${path}
3534export PATH=\$ MAVEN_HOME/bin:\$ PATH
3635EOF
3736source /etc/profile
3837
3938# 备份并替换 settings.xml,使用 aliyun 镜像加速 maven
40- echo -e " \n>>>>>>>>> replace /opt/maven/apache-maven- ${version } /conf/settings.xml"
41- cp /opt/maven/apache-maven- ${version } /conf/settings.xml /opt/maven/apache-maven- ${version } /conf/settings.xml.bak
42- wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O /opt/maven/apache-maven- ${version } /conf/settings.xml
39+ echo -e " \n>>>>>>>>> replace ${path } /conf/settings.xml"
40+ cp ${path } /conf/settings.xml ${path } /conf/settings.xml.bak
41+ wget -N https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/config/settings-aliyun.xml -O ${path } /conf/settings.xml
You can’t perform that action at this time.
0 commit comments