diff --git a/release/install-release.sh b/release/install-release.sh index e79377cb3..6c5a771c5 100755 --- a/release/install-release.sh +++ b/release/install-release.sh @@ -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."