Skip to content
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

install-release.sh中copyFile功能简化 #1038

Merged
merged 3 commits into from
Apr 12, 2018
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions release/install-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,12 @@ startV2ray(){

copyFile() {
NAME=$1
MANDATE=$2
ERROR=`cp "/tmp/v2ray/v2ray-${NEW_VER}-linux-${VDIS}/${NAME}" "/usr/bin/v2ray/${NAME}" 2>&1`
if [[ $? -ne 0 ]]; then
colorEcho ${YELLOW} "${ERROR}"
if [ "$MANDATE" = true ]; then
exit
fi
return 2
fi
return 0
}

makeExecutable() {
Expand All @@ -222,12 +220,12 @@ makeExecutable() {
installV2Ray(){
# Install V2Ray binary to /usr/bin/v2ray
mkdir -p /usr/bin/v2ray
copyFile v2ray true
copyFile v2ray || return $?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 return value 在调用的地方并没有处理。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改好了,之前写在另外一个pr里面了

makeExecutable v2ray
copyFile v2ctl false
copyFile v2ctl
makeExecutable v2ctl
copyFile geoip.dat false
copyFile geosite.dat false
copyFile geoip.dat
copyFile geosite.dat

# Install V2Ray server config to /etc/v2ray
mkdir -p /etc/v2ray
Expand Down