-
Notifications
You must be signed in to change notification settings - Fork 103
/
Copy pathinstall.sh
executable file
·90 lines (65 loc) · 1.69 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
USER=`whoami`
#彩色的看着舒服点
red() {
echo -e "\033[31m$1\033[0m \c"
}
green() {
echo -e "\033[32m$1\033[0m \c"
}
blue() {
echo -e "\033[34m$1\033[0m \c"
}
blue "### Welcome to Google Cloud Shell Auto Deploy Script ###";echo
green "FBI WARNING: 这只是个弱鸡脚本,高手勿喷哦~ -- By guleon.";echo
red "几点提示:
1、这个脚本执行一次就行了,下次使用只需要登录shell就行,不怕重置
2、环境部署好之后,在系统/SwichyOmega 添加socks5代理就行
3、如果一点不懂linux的,建议先学学linux再玩
";echo
green "能行吗?[Y/n]:"
read confirm
if [[ x$confirm == x || $confirm == "y" || $confirm == "Y" ]]
then
green "好嘞 ...";echo
else
red "拜拜了您嘞...";echo
exit 0
fi
if [[ -d $HOME/.goormide ]]
then
green "兄弟,老实交代是不是安装过了,要重新安装吗?[Y/n]"
read confirm
if [[ x$confirm == x || $confirm == "y" || $confirm == "Y" ]]
then
cd $HOME
kill -9 `pidof v2ray` 2>/dev/null
rm -fr .goormide goorm-auto 2>/dev/null
mv .bashrc_bak .bashrc
else
green "拜拜";echo
exit 0
fi
fi
cd $HOME
blue "下载需要的东西 ...";echo
git clone https://github.com/guleonseon/goorm-auto.git
sleep 1
blue "正在配置环境... ";echo
if [[ -f $HOME/.bashrc ]]
then
cp $HOME/.bashrc $HOME/.bashrc_bak
fi
#copy .goormide to $HOME
cp -r goorm-auto/.goormide $HOME
#配置自动运行
cat goorm-auto/profile >> .bashrc
.goormide/service.sh
sleep 2
v2ray_pid=`pidof v2ray`
if [[ x$v2ray_pid == x ]]
then
red "糟糕,我有种不详的预感,自己找找原因,咱先撤了!";echo
else
green "额...环境部署好了, Enjoy it!";echo
fi