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

add source parameter in install-release script

This commit is contained in:
Darien Raymond 2019-02-07 23:15:17 +01:00
parent a499f90b42
commit a167073bbc
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -18,6 +18,7 @@ V2RAY_RUNNING=0
VSRC_ROOT="/tmp/v2ray"
EXTRACT_ONLY=0
ERROR_IF_UPTODATE=0
DIST_SRC="github"
CMD_INSTALL=""
CMD_UPDATE=""
@ -73,6 +74,10 @@ while [[ $# > 0 ]];do
LOCAL_INSTALL="1"
shift
;;
--source)
DIST_SRC="$2"
shift
;;
--errifuptodate)
ERROR_IF_UPTODATE="1"
;;
@ -118,8 +123,12 @@ sysArch(){
downloadV2Ray(){
rm -rf /tmp/v2ray
mkdir -p /tmp/v2ray
colorEcho ${BLUE} "Downloading V2Ray."
DOWNLOAD_LINK="https://github.com/v2ray/v2ray-core/releases/download/${NEW_VER}/v2ray-linux-${VDIS}.zip"
if [[ "${DIST_SRC}" == "jsdelivr" ]]; then
DOWNLOAD_LINK="https://cdn.jsdelivr.net/gh/v2ray/dist/v2ray-linux-${VDIS}.zip"
else
DOWNLOAD_LINK="https://github.com/v2ray/v2ray-core/releases/download/${NEW_VER}/v2ray-linux-${VDIS}.zip"
fi
colorEcho ${BLUE} "Downloading V2Ray: ${DOWNLOAD_LINK}"
curl ${PROXY} -L -H "Cache-Control: no-cache" -o ${ZIPFILE} ${DOWNLOAD_LINK}
if [ $? != 0 ];then
colorEcho ${RED} "Failed to download! Please check your network or try again."