diff --git a/codes/linux/ops/build/java-app-boot.sh b/codes/linux/ops/build/java-app-boot.sh index 44c90dd..4879c08 100644 --- a/codes/linux/ops/build/java-app-boot.sh +++ b/codes/linux/ops/build/java-app-boot.sh @@ -2,7 +2,7 @@ ################################################################################# # JAVA 应用通用启动脚本 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################# # 检查脚本参数,如必要参数未传入,退出脚本。 diff --git a/codes/linux/ops/build/java-app-release.sh b/codes/linux/ops/build/java-app-release.sh index a5e9788..45d916c 100644 --- a/codes/linux/ops/build/java-app-release.sh +++ b/codes/linux/ops/build/java-app-release.sh @@ -2,7 +2,7 @@ ################################################################################# # JAVA 应用发布脚本 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################# # 检查脚本参数,如必要参数未传入,退出脚本。 diff --git a/codes/linux/ops/build/java-app-run.sh b/codes/linux/ops/build/java-app-run.sh index 783169e..88dfc4e 100644 --- a/codes/linux/ops/build/java-app-run.sh +++ b/codes/linux/ops/build/java-app-run.sh @@ -2,7 +2,7 @@ ################################################################################# # JAVA 应用运行脚本 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################# # 检查脚本参数,如必要参数未传入,退出脚本。 diff --git a/codes/linux/ops/build/main.sh b/codes/linux/ops/build/main.sh index 5db7244..a74f73a 100644 --- a/codes/linux/ops/build/main.sh +++ b/codes/linux/ops/build/main.sh @@ -2,7 +2,7 @@ ################################################################################### # 项目发布脚本模板 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### # 选择应用 diff --git a/codes/linux/ops/build/update-code.sh b/codes/linux/ops/build/update-code.sh index fcbba02..5a3a0df 100644 --- a/codes/linux/ops/build/update-code.sh +++ b/codes/linux/ops/build/update-code.sh @@ -3,7 +3,7 @@ ################################################################################### # 更新代码脚本 # 只有退出码(exit code)为 0 ,表示脚本执行成功。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### # 检查脚本参数,如必要参数未传入,退出脚本。 diff --git a/codes/linux/ops/soft/README.md b/codes/linux/ops/soft/README.md index b3827c1..c402fd5 100644 --- a/codes/linux/ops/soft/README.md +++ b/codes/linux/ops/soft/README.md @@ -1,5 +1,20 @@ # 服务安装配置 +## oh-my-zsh 安装 + +说明: + +安装 [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh) + +使用方法: + +执行以下任意命令即可执行安装脚本。 + +```sh +curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash +wget -qO- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-install.sh | bash +``` + ## JDK8 安装 说明: diff --git a/codes/linux/ops/soft/git/install-gitlab.sh b/codes/linux/ops/soft/git/install-gitlab.sh index 37c7188..f06b5e6 100644 --- a/codes/linux/ops/soft/git/install-gitlab.sh +++ b/codes/linux/ops/soft/git/install-gitlab.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 Gitlab 脚本 # 仅适用于 CentOS7 发行版本 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install gitlab" diff --git a/codes/linux/ops/soft/jdk8-install.sh b/codes/linux/ops/soft/jdk8-install.sh index 1f1e339..c87483e 100644 --- a/codes/linux/ops/soft/jdk8-install.sh +++ b/codes/linux/ops/soft/jdk8-install.sh @@ -4,9 +4,9 @@ cat << EOF ################################################################################### # 安装 JDK8 脚本 -# 仅适用于所有 CentOS 发行版本 # JDK 会被安装到 /usr/lib/jvm/java 路径。 -# Author: Zhang Peng +# @system: 适用于 CentOS +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/soft/jenkins/install-jenkins.sh b/codes/linux/ops/soft/jenkins/install-jenkins.sh index 86ebb43..722da2d 100644 --- a/codes/linux/ops/soft/jenkins/install-jenkins.sh +++ b/codes/linux/ops/soft/jenkins/install-jenkins.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 Jenkins 脚本 # 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install jenkins" diff --git a/codes/linux/ops/soft/kafka/install-kafka.sh b/codes/linux/ops/soft/kafka/install-kafka.sh index 368d593..c5e6c79 100644 --- a/codes/linux/ops/soft/kafka/install-kafka.sh +++ b/codes/linux/ops/soft/kafka/install-kafka.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 kafka 脚本 # 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### # 下载并解压 kafka diff --git a/codes/linux/ops/soft/main.sh b/codes/linux/ops/soft/main.sh index a09c542..67111d1 100644 --- a/codes/linux/ops/soft/main.sh +++ b/codes/linux/ops/soft/main.sh @@ -11,15 +11,17 @@ EOF path=$(cd "$(dirname "$0")"; pwd) PS3="Please select script type: " -select item in "git" "jdk" "maven" "nodejs" "redis" +select item in "git" "zsh" "jdk" "maven" "nodejs" "redis" "tomcat" do path=$(cd "$(dirname "$0")"; pwd) case ${item} in "git") yum install -y git ;; + "zsh") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/zsh-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") curl -o- 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/soft/redis-install.sh | bash ;; + "tomcat") curl -o- https://raw.githubusercontent.com/dunwu/os-tutorial/master/codes/linux/ops/soft/tomcat8-install.sh | bash ;; *) echo -e "输入项不支持!" main diff --git a/codes/linux/ops/soft/maven-install.sh b/codes/linux/ops/soft/maven-install.sh index 4ecd8d3..8ad2dba 100644 --- a/codes/linux/ops/soft/maven-install.sh +++ b/codes/linux/ops/soft/maven-install.sh @@ -3,10 +3,10 @@ cat << EOF ################################################################################### # 安装 Maven3 脚本 -# 适用于所有 linux 发行版本。 # Maven 会被安装到 /opt/maven 路径。 +# @system: 适用于所有 linux 发行版本。 # 注意:Maven 要求必须先安装 JDK -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/soft/mongodb/install-mongodb.sh b/codes/linux/ops/soft/mongodb/install-mongodb.sh index 34dea34..c8a8668 100644 --- a/codes/linux/ops/soft/mongodb/install-mongodb.sh +++ b/codes/linux/ops/soft/mongodb/install-mongodb.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 mongodb 脚本 # 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install mongodb" diff --git a/codes/linux/ops/soft/nexus-install.sh b/codes/linux/ops/soft/nexus-install.sh index fce0b8f..193cbd8 100644 --- a/codes/linux/ops/soft/nexus-install.sh +++ b/codes/linux/ops/soft/nexus-install.sh @@ -2,10 +2,10 @@ ################################################################################### # 安装 sonatype nexus(用于搭建 maven 私服) 脚本 -# 适用于所有 linux 发行版本。 +# @system: 适用于所有 linux 发行版本。 # sonatype nexus 会被安装到 /opt/maven 路径。 # 注意:sonatype nexus 要求必须先安装 JDK -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install sonatype nexus" diff --git a/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh b/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh index 9a89576..6248e56 100644 --- a/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh +++ b/codes/linux/ops/soft/nginx/install-nginx-by-rpm.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 nginx 脚本 # 仅适用于 CentOS 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install nginx" diff --git a/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh b/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh index b0066a9..bec957b 100644 --- a/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh +++ b/codes/linux/ops/soft/nginx/install-nginx-by-yum.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 nginx 脚本 # 仅适用于 CentOS 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install nginx" diff --git a/codes/linux/ops/soft/nginx/install-nginx.sh b/codes/linux/ops/soft/nginx/install-nginx.sh index d8890ea..fec7365 100644 --- a/codes/linux/ops/soft/nginx/install-nginx.sh +++ b/codes/linux/ops/soft/nginx/install-nginx.sh @@ -6,7 +6,7 @@ # nginx 会被安装到 /opt/nginx 路径。 # 注意:安装 nginx 需要依赖以下库,需预先安装: # zlib zlib-devel gcc-c++ libtool openssl openssl-devel -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install nginx" diff --git a/codes/linux/ops/soft/nginx/install-pcre.sh b/codes/linux/ops/soft/nginx/install-pcre.sh index e4f02f6..b78b7ce 100644 --- a/codes/linux/ops/soft/nginx/install-pcre.sh +++ b/codes/linux/ops/soft/nginx/install-pcre.sh @@ -4,7 +4,7 @@ # 安装 pcre 脚本 # 适用于所有 linux 发行版本。 # 注意:本脚本需输入根路径和版本号两个参数。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install pcre" diff --git a/codes/linux/ops/soft/nodejs-install.sh b/codes/linux/ops/soft/nodejs-install.sh index 23b6755..fc3f13c 100644 --- a/codes/linux/ops/soft/nodejs-install.sh +++ b/codes/linux/ops/soft/nodejs-install.sh @@ -4,8 +4,8 @@ cat << EOF ################################################################################### # 安装 Nodejs 脚本 -# 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @system: 适用于所有 linux 发行版本。 +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/soft/redis-install.sh b/codes/linux/ops/soft/redis-install.sh index 093b984..0fb8943 100644 --- a/codes/linux/ops/soft/redis-install.sh +++ b/codes/linux/ops/soft/redis-install.sh @@ -4,7 +4,8 @@ cat << EOF ################################################################################### # 安装 Redis 脚本 -# Author: Zhang Peng +# @system: 适用于 CentOS +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/soft/rocketmq/install-rocketmq.sh b/codes/linux/ops/soft/rocketmq/install-rocketmq.sh index bcf2686..7b55595 100644 --- a/codes/linux/ops/soft/rocketmq/install-rocketmq.sh +++ b/codes/linux/ops/soft/rocketmq/install-rocketmq.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 rocketmq 脚本 # 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### # 下载并解压 rocketmq diff --git a/codes/linux/ops/soft/springboot/install-springboot.sh b/codes/linux/ops/soft/springboot/install-springboot.sh deleted file mode 100644 index 5344ce2..0000000 --- a/codes/linux/ops/soft/springboot/install-springboot.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -echo -e "\n>>>>>>>>> install springboot" - -sdk version -execode=$? -if [ "${execode}" != "0" ]; then - echo "请先安装 sdkman" - exit 1 -fi - -sdk install springboot -spring --version diff --git a/codes/linux/ops/soft/tomcat8-install.sh b/codes/linux/ops/soft/tomcat8-install.sh index 2ba1613..3cc0146 100644 --- a/codes/linux/ops/soft/tomcat8-install.sh +++ b/codes/linux/ops/soft/tomcat8-install.sh @@ -4,8 +4,8 @@ cat << EOF ################################################################################### # 安装 Tomcat 脚本 -# 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @system: 适用于所有 linux 发行版本。 +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/soft/zookeeper/install-zookeeper.sh b/codes/linux/ops/soft/zookeeper/install-zookeeper.sh index 29491ce..29b1e5b 100644 --- a/codes/linux/ops/soft/zookeeper/install-zookeeper.sh +++ b/codes/linux/ops/soft/zookeeper/install-zookeeper.sh @@ -3,7 +3,7 @@ ################################################################################### # 安装 zookeeper 脚本 # 适用于所有 linux 发行版本。 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> install zookeeper" diff --git a/codes/linux/ops/soft/zsh/install-zsh.sh b/codes/linux/ops/soft/zsh-install.sh similarity index 80% rename from codes/linux/ops/soft/zsh/install-zsh.sh rename to codes/linux/ops/soft/zsh-install.sh index 3b4cc5c..dcf91ca 100644 --- a/codes/linux/ops/soft/zsh/install-zsh.sh +++ b/codes/linux/ops/soft/zsh-install.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash +cat << EOF + ################################################################################### # 安装 zsh、oh-my-zsh 脚本 -# 适用于 CentOS -# Author: Zhang Peng +# @system: 适用于 CentOS +# @author: Zhang Peng +# See: https://github.com/robbyrussell/oh-my-zsh ################################################################################### -echo -e "\n>>>>>>>>> install zsh" +EOF -# 安装 zsh +echo -e "\n>>>>>>>>> install zsh" yum install -y zsh -# 安装 oh-my-zsh + +echo -e "\n>>>>>>>>> install oh-my-zsh" wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh # 替换 oh-my-zsh 主题 sed -i "s#^ZSH_THEME=.*#ZSH_THEME=\"ys\"#g" ~/.zshrc diff --git a/codes/linux/ops/sys/install-libs.sh b/codes/linux/ops/sys/install-libs.sh index 0fa494e..02cec37 100644 --- a/codes/linux/ops/sys/install-libs.sh +++ b/codes/linux/ops/sys/install-libs.sh @@ -2,7 +2,7 @@ ################################################################################### # 安装常见 lib -# Author: Zhang Peng +# @author: Zhang Peng # # 如果不知道某个命令工具是由哪个包提供的,使用 yum provides xxx # 或 yum whatprovides xxx 来查找 diff --git a/codes/linux/ops/sys/install-tools.sh b/codes/linux/ops/sys/install-tools.sh index 5c8cfe6..01f3d77 100644 --- a/codes/linux/ops/sys/install-tools.sh +++ b/codes/linux/ops/sys/install-tools.sh @@ -3,7 +3,7 @@ cat << EOF ################################################################################### # 安装基本的命令工具 -# Author: Zhang Peng +# @author: Zhang Peng # # 如果不知道某个命令工具是由哪个包提供的,使用 yum provides xxx # 或 yum whatprovides xxx 来查找 diff --git a/codes/linux/ops/sys/main.sh b/codes/linux/ops/sys/main.sh index 176f099..21b3c5c 100644 --- a/codes/linux/ops/sys/main.sh +++ b/codes/linux/ops/sys/main.sh @@ -4,7 +4,7 @@ printHeadInfo() { cat << EOF ################################################################################### # Linux CentOS 环境初始化脚本(设置环境配置、安装基本的命令工具) -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/sys/set-dns.sh b/codes/linux/ops/sys/set-dns.sh index 1f085f2..ff3c389 100644 --- a/codes/linux/ops/sys/set-dns.sh +++ b/codes/linux/ops/sys/set-dns.sh @@ -3,7 +3,7 @@ ################################################################################### # 在 /etc/resolv.conf 中设置 DNS 服务器 # 在 /etc/hosts 中设置本机域名 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### ip='127.0.0.1' function getDeviceIp() { diff --git a/codes/linux/ops/sys/set-ntp.sh b/codes/linux/ops/sys/set-ntp.sh index 5cb0637..29945fd 100644 --- a/codes/linux/ops/sys/set-ntp.sh +++ b/codes/linux/ops/sys/set-ntp.sh @@ -3,7 +3,7 @@ ################################################################################### # 使用 NTP 进行时间同步 # 参考:https://www.cnblogs.com/quchunhui/p/7658853.html -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### echo -e "\n>>>>>>>>> 设置 ntp" diff --git a/codes/linux/ops/sys/stop-firewall.sh b/codes/linux/ops/sys/stop-firewall.sh index 3fba3ff..0982427 100644 --- a/codes/linux/ops/sys/stop-firewall.sh +++ b/codes/linux/ops/sys/stop-firewall.sh @@ -3,7 +3,7 @@ ################################################################################### # 彻底关闭防火墙 # 参考:https://www.cnblogs.com/moxiaoan/p/5683743.html -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### systemctl stop firewalld diff --git a/codes/linux/ops/sys/sys-settings.sh b/codes/linux/ops/sys/sys-settings.sh index 2485094..107bacd 100644 --- a/codes/linux/ops/sys/sys-settings.sh +++ b/codes/linux/ops/sys/sys-settings.sh @@ -4,7 +4,7 @@ printHeadInfo() { cat << EOF ################################################################################### # Linux Centos7 系统配置脚本(根据需要选择) -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### EOF diff --git a/codes/linux/ops/sys/yum/change-yum-repo.sh b/codes/linux/ops/sys/yum/change-yum-repo.sh index 0a9f835..c9977af 100644 --- a/codes/linux/ops/sys/yum/change-yum-repo.sh +++ b/codes/linux/ops/sys/yum/change-yum-repo.sh @@ -4,7 +4,7 @@ cat << EOF ################################################################################### # 本脚本用于替换 yum repo,使用国内 yum 仓库,加速下载 # 要求:仅适用于 Linux CentOS 发行版本,并且环境必须已支持 yum 、lsb_release 命令 -# Author: Zhang Peng +# @author: Zhang Peng ################################################################################### EOF