Skip to content

Commit 45ac298

Browse files
committed
update scriptes
1 parent 7cdb040 commit 45ac298

8 files changed

Lines changed: 67 additions & 20 deletions

File tree

codes/linux/soft/jdk8-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ printf "${RESET}"
2828
printf "${BLUE}>>>>>>>> install jdk8\n${RESET}"
2929

3030
command -v yum >/dev/null 2>&1 || {
31-
printf "${RED}Require yum but it's not installed. Aborting.\n${RESET}"
32-
echo >&2 "Require yum but it's not installed. Aborting.";
31+
printf "${RED}Require yum but it's not installed.\n${RESET}"
32+
printf "${RED}Require yum but it's not installed.${RESET}\n";
3333
exit 1;
3434
}
3535

codes/linux/soft/maven-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cat << EOF
1010
###################################################################################
1111
EOF
1212

13-
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed. Aborting."; exit 1; }
13+
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed."; exit 1; }
1414

1515
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
1616
echo "Usage: sh maven-install.sh [version] [path]"

codes/linux/soft/nacos-install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ cat << EOF
1111
1212
EOF
1313

14-
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed. Aborting."; exit 1; }
15-
command -v mvn >/dev/null 2>&1 || { echo >&2 "Require mvn but it's not installed. Aborting."; exit 1; }
14+
command -v java >/dev/null 2>&1 || { echo >&2 "Require java but it's not installed."; exit 1; }
15+
command -v mvn >/dev/null 2>&1 || { echo >&2 "Require mvn but it's not installed."; exit 1; }
1616

1717
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
1818
echo "Usage: sh nacos-install.sh [version] [path]"

codes/linux/soft/nginx-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cat << EOF
1111
1212
EOF
1313

14-
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; }
14+
command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
1515

1616
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
1717
echo "Usage: sh nginx-install.sh [version] [path]"

codes/linux/soft/nodejs-install.sh

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

3+
###################################################################################
4+
# 控制台颜色
5+
BLACK="\033[1;30m"
6+
RED="\033[1;31m"
7+
GREEN="\033[1;32m"
8+
YELLOW="\033[1;33m"
9+
BLUE="\033[1;34m"
10+
PURPLE="\033[1;35m"
11+
CYAN="\033[1;36m"
12+
RESET="$(tput sgr0)"
13+
###################################################################################
14+
15+
printf "${BLUE}"
316
cat << EOF
417
518
###################################################################################
@@ -9,6 +22,9 @@ cat << EOF
922
###################################################################################
1023
1124
EOF
25+
printf "${RESET}"
26+
27+
printf "${BLUE}>>>>>>>> install nodejs\n${RESET}"
1228

1329
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
1430
echo "Usage: sh nodejs-install.sh [version] [path]"
@@ -36,3 +52,5 @@ echo -e "\n>>>>>>>>> install nodejs by nvm"
3652
nvm install ${version}
3753
nvm use ${version}
3854
node --version
55+
56+
printf "${GREEN}<<<<<<<< install zsh nodejs\n${RESET}"

codes/linux/soft/redis-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cat << EOF
1010
1111
EOF
1212

13-
command -v yum >/dev/null 2>&1 || { echo >&2 "Require yum but it's not installed. Aborting."; exit 1; }
13+
command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
1414

1515
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]] || [[ $# -lt 3 ]] || [[ $# -lt 4 ]];then
1616
echo "Usage: sh redis-install.sh [version] [path] [port] [password]"

codes/linux/soft/zookeeper-install.sh

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

3+
###################################################################################
4+
# 控制台颜色
5+
BLACK="\033[1;30m"
6+
RED="\033[1;31m"
7+
GREEN="\033[1;32m"
8+
YELLOW="\033[1;33m"
9+
BLUE="\033[1;34m"
10+
PURPLE="\033[1;35m"
11+
CYAN="\033[1;36m"
12+
RESET="$(tput sgr0)"
13+
###################################################################################
14+
15+
printf "${BLUE}"
316
cat << EOF
417
518
###################################################################################
@@ -9,6 +22,7 @@ cat << EOF
922
###################################################################################
1023
1124
EOF
25+
printf "${RESET}"
1226

1327
if [[ $# -lt 1 ]] || [[ $# -lt 2 ]];then
1428
echo "Usage: sh zookeeper-install.sh [version] [path]"

codes/linux/soft/zsh-install.sh

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

3+
###################################################################################
4+
# 控制台颜色
5+
BLACK="\033[1;30m"
6+
RED="\033[1;31m"
7+
GREEN="\033[1;32m"
8+
YELLOW="\033[1;33m"
9+
BLUE="\033[1;34m"
10+
PURPLE="\033[1;35m"
11+
CYAN="\033[1;36m"
12+
RESET="$(tput sgr0)"
13+
###################################################################################
14+
15+
printf "${BLUE}"
316
cat << EOF
417
518
###################################################################################
@@ -10,21 +23,23 @@ cat << EOF
1023
###################################################################################
1124
1225
EOF
26+
printf "${RESET}"
1327

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

16-
echo -e "\n>>>>>>>>> install zsh"
17-
yum install -y zsh
30+
command -v yum >/dev/null 2>&1 || { printf "${RED}Require yum but it's not installed.${RESET}\n"; exit 1; }
1831

19-
echo -e "\n>>>>>>>>> install oh-my-zsh"
32+
# install zsh
33+
yum install -y zsh
34+
# install oh-my-zsh
2035
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh
21-
# 替换 oh-my-zsh 主题
22-
sed -i "s#^ZSH_THEME=.*#ZSH_THEME=\"ys\"#g" ~/.zshrc
23-
# 下载 incr.zsh 补全插件
24-
wget http://mimosa-pudica.net/src/incr-0.2cd.zsh
25-
mkdir ~/.oh-my-zsh/plugins/incr/
26-
mv incr-0.2.zsh ~/.oh-my-zsh/plugins/incr/
27-
echo "source ~/.oh-my-zsh/plugins/incr/incr*.zsh" >> ~/.zshrc
28-
29-
# 更新配置
36+
# choose oh-my-zsh theme
37+
sed -i "s/^ZSH_THEME=.*/ZSH_THEME=\"ys\"/g" ~/.zshrc
38+
# install oh-my-zsh plugins
39+
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/plugins/zsh-autosuggestions
40+
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ~/.oh-my-zsh/plugins/zsh-syntax-highlighting
41+
sed -i "s/^plugins=.*/plugins=(git z wd extract zsh-autosuggestions zsh-syntax-highlighting)/g" ~/.zshrc
42+
# reload zsh
3043
source ~/.zshrc
44+
45+
printf "${GREEN}<<<<<<<< install zsh finished\n${RESET}"

0 commit comments

Comments
 (0)