@@ -27,8 +27,6 @@ red=$(tput setaf 1)
2727green=$( tput setaf 2)
2828reset=$( tput sgr0)
2929
30- alias curl=' "curl" --retry 5 --retry-delay 10 --retry-max-time 60 --false-start --http2 --tlsv1.2 -L'
31-
3230check_if_running_as_root () {
3331 # If you want to run as another user, please modify $UID to be owned by this user
3432 if [[ " $UID " -ne ' 0' ]]; then
@@ -172,7 +170,7 @@ judgment_parameters() {
172170
173171install_software () {
174172 COMPONENT=" $1 "
175- command -v " $COMPONENT " > /dev/null 2>&1 && return
173+ command -v " $COMPONENT " > /dev/null 2>&1 && return
176174 if ${PACKAGE_MANAGEMENT_INSTALL} " $COMPONENT " ; then
177175 echo " info: $COMPONENT is installed."
178176 else
@@ -213,7 +211,7 @@ get_version() {
213211 TMP_FILE=" $( mktemp) "
214212 install_software curl
215213 # DO NOT QUOTE THESE `${PROXY}` VARIABLES!
216- if ! curl ${PROXY} -sS -H " Accept: application/vnd.github.v3+json" -o " $TMP_FILE " ' https://api.github.com/repos/v2fly/v2ray-core/releases/latest' ; then
214+ if ! " curl" ${PROXY} -sSL -H " Accept: application/vnd.github.v3+json" -o " $TMP_FILE " ' https://api.github.com/repos/v2fly/v2ray-core/releases/latest' ; then
217215 " rm" " $TMP_FILE "
218216 echo ' error: Failed to get release list, please check your network.'
219217 exit 1
@@ -256,12 +254,12 @@ get_version() {
256254download_v2ray () {
257255 DOWNLOAD_LINK=" https://github.com/v2fly/v2ray-core/releases/download/$RELEASE_VERSION /v2ray-linux-$MACHINE .zip"
258256 echo " Downloading V2Ray archive: $DOWNLOAD_LINK "
259- if ! curl ${PROXY} -R -H ' Cache-Control: no-cache' -o " $ZIP_FILE " " $DOWNLOAD_LINK " ; then
257+ if ! " curl" ${PROXY} -sSLR -H " Accept: application/vnd.github.v3+json " -H ' Cache-Control: no-cache' -o " $ZIP_FILE " " $DOWNLOAD_LINK " ; then
260258 echo ' error: Download failed! Please check your network or try again.'
261259 return 1
262260 fi
263261 echo " Downloading verification file for V2Ray archive: $DOWNLOAD_LINK .dgst"
264- if ! curl ${PROXY} -sSR -H ' Cache-Control: no-cache' -o " $ZIP_FILE .dgst" " $DOWNLOAD_LINK .dgst" ; then
262+ if ! " curl" ${PROXY} -L -H ' Cache-Control: no-cache' -o " $ZIP_FILE .dgst" " $DOWNLOAD_LINK .dgst" ; then
265263 echo ' error: Download failed! Please check your network or try again.'
266264 return 1
267265 fi
@@ -314,7 +312,7 @@ install_v2ray() {
314312 # Install V2Ray configuration file to $JSON_PATH
315313 if [[ -z " $JSONS_PATH " ]] && [[ ! -d " $JSON_PATH " ]]; then
316314 install -d " $JSON_PATH "
317- echo " {}" > " ${JSON_PATH} /config.json"
315+ echo " {}" > " ${JSON_PATH} /config.json"
318316 CONFIG_NEW=' 1'
319317 fi
320318
0 commit comments