-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update install-release.sh #350
Conversation
Current coverage is 68.49% (diff: 100%)@@ master #350 diff @@
==========================================
Files 168 168
Lines 9341 9231 -110
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6306 6323 +17
+ Misses 2415 2282 -133
- Partials 620 626 +6
|
############################### | ||
colorEcho(){ | ||
color=$1 | ||
text=$2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
text 没有用到
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
后来修改时忘记删了
if [[ $SOFTWARE_UPDATED -eq 0 ]]; then | ||
colorEcho ${wblue} "Updating software repo" | ||
$CMD_UPDATE | ||
if [[ $? -ne 0 ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个检查似乎没什么意义,即使更新失败,也可能可以安装软件。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
想了想好像还真是这样,而且一般 update 也不会出错
echo " -h, --help Show help" | ||
echo " -p, --proxy To download through a proxy server, use -p socks5:https://127.0.0.1:1080 or -p http:https://127.0.0.1:3128 etc" | ||
echo " -f, --force Force install" | ||
echo " -v, --version Install a particular version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'-v' 通常是指 verbose,最好不要用于其它的指令
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我确实不清楚有这样的惯例
echo " -f, --force Force install" | ||
echo " -v, --version Install a particular version" | ||
echo " -l, --local Install from a local file" | ||
echo " -r, --remove Remove installed V2Ray" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove 也不要有短指令,以防误操作。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
也没想到过这样的情况
if pgrep "v2ray" > /dev/null ; then | ||
stopV2ray | ||
fi | ||
rm -rf "/usr/lib/v2ray" "/lib/systemd/system/v2ray.service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删 service 之前应该要先 disable service,另外还有 sysv 的 service。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
疏忽。这些问题我都改一下
针对你提出的问题作了相应修改 |
stopV2ray | ||
fi | ||
systemctl disable v2ray.service | ||
rm -rf "/usr/lib/v2ray" "/lib/systemd/system/v2ray.service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里应该是 /usr/bin/ 而不是 /usr/lib,下同。
应该没什么问题,最后一个 commet 改好就 merge。不过最新的 go.sh 实际上不是这个文件,之后我自己同步一下好了。 |
修改完成 |
非常感谢 |
花了点时间写了个脚本,在 Debian 8、Debian testing、 Ubuntu 14.04 测试无问题。主要变化: