1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-27 01:45:23 +00:00

Merge pull request #1039 from sunshineplan/4

install-release.sh增加启动和停止服务失败的提醒
This commit is contained in:
DarienRaymond 2018-04-12 11:20:06 +02:00 committed by GitHub
commit 7d800168aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,11 @@
# This file is accessible as https://install.direct/go.sh
# Original source is located at github.com/v2ray/v2ray-core/release/install-release.sh
# If not specify, default meaning of return value:
# 1: System error
# 2: Application error
# 3: Network error
CUR_VER=""
NEW_VER=""
ARCH=""
@ -186,6 +191,10 @@ stopV2ray(){
elif [[ -n "${SERVICE_CMD}" ]] || [[ -f "/etc/init.d/v2ray" ]]; then
${SERVICE_CMD} v2ray stop
fi
if [[ $? -ne 0 ]]; then
colorEcho ${RED} "Failed to shutdown V2Ray service."
return 2
fi
return 0
}
@ -200,6 +209,10 @@ startV2ray(){
elif [ -n "${SERVICE_CMD}" ] && [ -f "/etc/init.d/v2ray" ]; then
${SERVICE_CMD} v2ray start
fi
if [[ $? -ne 0 ]]; then
colorEcho ${RED} "Failed to start V2Ray service."
return 2
fi
return 0
}