|
|
@@ -1305,17 +1305,17 @@ install_x-ui() {
|
|
|
|
|
|
# Download resources
|
|
|
if [ $# == 0 ]; then
|
|
|
- tag_version=$(curl -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
|
+ tag_version=$(curl -Ls --retry 5 --retry-delay 3 --connect-timeout 15 --max-time 60 "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
|
if [[ ! -n "$tag_version" ]]; then
|
|
|
echo -e "${yellow}Trying to fetch version with IPv4...${plain}"
|
|
|
- tag_version=$(curl -4 -Ls "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
|
+ tag_version=$(curl -4 -Ls --retry 5 --retry-delay 3 --connect-timeout 15 --max-time 60 "https://api.github.com/repos/MHSanaei/3x-ui/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
|
|
|
if [[ ! -n "$tag_version" ]]; then
|
|
|
echo -e "${red}Failed to fetch x-ui version, it may be due to GitHub API restrictions, please try it later${plain}"
|
|
|
exit 1
|
|
|
fi
|
|
|
fi
|
|
|
echo -e "Got x-ui latest version: ${tag_version}, beginning the installation..."
|
|
|
- curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz
|
|
|
+ curl -4fLR --retry 5 --retry-delay 3 --connect-timeout 15 --max-time 300 -o ${xui_folder}-linux-$(arch).tar.gz https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
echo -e "${red}Downloading x-ui failed, please be sure that your server can access GitHub ${plain}"
|
|
|
exit 1
|
|
|
@@ -1332,7 +1332,7 @@ install_x-ui() {
|
|
|
|
|
|
url="https://github.com/MHSanaei/3x-ui/releases/download/${tag_version}/x-ui-linux-$(arch).tar.gz"
|
|
|
echo -e "Beginning to install x-ui $1"
|
|
|
- curl -4fLRo ${xui_folder}-linux-$(arch).tar.gz ${url}
|
|
|
+ curl -4fLR --retry 5 --retry-delay 3 --connect-timeout 15 --max-time 300 -o ${xui_folder}-linux-$(arch).tar.gz ${url}
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
echo -e "${red}Download x-ui $1 failed, please check if the version exists ${plain}"
|
|
|
exit 1
|