update scriptes

This commit is contained in:
Zhang Peng 2019-07-12 10:17:32 +08:00
parent 7cdb040a0c
commit 45ac298595
8 changed files with 67 additions and 20 deletions

View File

@ -28,8 +28,8 @@ printf "${RESET}"
printf "${BLUE}>>>>>>>> install jdk8\n${RESET}" printf "${BLUE}>>>>>>>> install jdk8\n${RESET}"
command -v yum >/dev/null 2>&1 || { command -v yum >/dev/null 2>&1 || {
printf "${RED}Require yum but it's not installed. Aborting.\n${RESET}" printf "${RED}Require yum but it's not installed.\n${RESET}"
echo >&2 "Require yum but it's not installed. Aborting."; printf "${RED}Require yum but it's not installed.${RESET}\n";
exit 1; exit 1;
} }

View File

@ -10,7 +10,7 @@ cat << EOF
################################################################################### ###################################################################################
EOF EOF
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed. Aborting."; exit 1; } command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed."; exit 1; }
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
echo "Usage: sh maven-install.sh [version] [path]" echo "Usage: sh maven-install.sh [version] [path]"

View File

@ -11,8 +11,8 @@ cat << EOF
EOF EOF
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed. Aborting."; exit 1; } command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed."; exit 1; }
command -v mvn >/dev/null 2>&1 || { echo >&2 "Require mvn but it's not installed. Aborting."; exit 1; } command -v mvn >/dev/null 2>&1 || { echo >&2 "Require mvn but it's not installed."; exit 1; }
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
echo "Usage: sh nacos-install.sh [version] [path]" echo "Usage: sh nacos-install.sh [version] [path]"

View File

@ -11,7 +11,7 @@ cat << EOF
EOF EOF
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; } command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
echo "Usage: sh nginx-install.sh [version] [path]" echo "Usage: sh nginx-install.sh [version] [path]"

View File

@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
###################################################################################
# 控制台颜色
BLACK="\033[1;30m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PURPLE="\033[1;35m"
CYAN="\033[1;36m"
RESET="$(tput sgr0)"
###################################################################################
printf "${BLUE}"
cat << EOF cat << EOF
################################################################################### ###################################################################################
@ -9,6 +22,9 @@ cat << EOF
################################################################################### ###################################################################################
EOF EOF
printf "${RESET}"
printf "${BLUE}>>>>>>>> install nodejs\n${RESET}"
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
echo "Usage: sh nodejs-install.sh [version] [path]" echo "Usage: sh nodejs-install.sh [version] [path]"
@ -36,3 +52,5 @@ echo -e "\n>>>>>>>>> install nodejs by nvm"
nvm install ${version} nvm install ${version}
nvm use ${version} nvm use ${version}
node --version node --version
printf "${GREEN}<<<<<<<< install zsh nodejs\n${RESET}"

View File

@ -10,7 +10,7 @@ cat << EOF
EOF EOF
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; } command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]] || [[ $# -lt 3 ]] || [[ $# -lt 4 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]] || [[ $# -lt 3 ]] || [[ $# -lt 4 ]];then
echo "Usage: sh redis-install.sh [version] [path] [port] [password]" echo "Usage: sh redis-install.sh [version] [path] [port] [password]"

View File

@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
###################################################################################
# 控制台颜色
BLACK="\033[1;30m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PURPLE="\033[1;35m"
CYAN="\033[1;36m"
RESET="$(tput sgr0)"
###################################################################################
printf "${BLUE}"
cat << EOF cat << EOF
################################################################################### ###################################################################################
@ -9,6 +22,7 @@ cat << EOF
################################################################################### ###################################################################################
EOF EOF
printf "${RESET}"
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
echo "Usage: sh zookeeper-install.sh [version] [path]" echo "Usage: sh zookeeper-install.sh [version] [path]"

View File

@ -1,5 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
###################################################################################
# 控制台颜色
BLACK="\033[1;30m"
RED="\033[1;31m"
GREEN="\033[1;32m"
YELLOW="\033[1;33m"
BLUE="\033[1;34m"
PURPLE="\033[1;35m"
CYAN="\033[1;36m"
RESET="$(tput sgr0)"
###################################################################################
printf "${BLUE}"
cat << EOF cat << EOF
################################################################################### ###################################################################################
@ -10,21 +23,23 @@ cat << EOF
################################################################################### ###################################################################################
EOF EOF
printf "${RESET}"
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; } printf "${BLUE}>>>>>>>> install zsh\n${RESET}"
echo -e "\n>>>>>>>>> install zsh" command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
# install zsh
yum install -y zsh yum install -y zsh
# install 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 wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
# 替换 oh-my-zsh 主题 # choose oh-my-zsh theme
sed -i "s#^ZSH_THEME=.*#ZSH_THEME=\"ys\"#g" ~/.zshrc sed -i "s/^ZSH_THEME=.*/ZSH_THEME=\"ys\"/g" ~/.zshrc
# 下载 incr.zsh 补全插件 # install oh-my-zsh plugins
wget http://mimosa-pudica.net/src/incr-0.2cd.zsh git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions
mkdir ~/.oh-my-zsh/plugins/incr/ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/ sed -i "s/^plugins=.*/plugins=(git z wd extract zsh-autosuggestions zsh-syntax-highlighting)/g" ~/.zshrc
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc # reload zsh
# 更新配置
source ~/.zshrc source ~/.zshrc
printf "${GREEN}<<<<<<<< install zsh finished\n${RESET}"