mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
Add bfsu mirror as another mirror of tuna (#2682)
* add bfsu for china mirror
This commit is contained in:
@@ -175,6 +175,8 @@ create_sources_list()
|
||||
# stage: add armbian repository and install key
|
||||
if [[ $DOWNLOAD_MIRROR == "china" ]]; then
|
||||
echo "deb http://mirrors.tuna.tsinghua.edu.cn/armbian $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > "${SDCARD}"/etc/apt/sources.list.d/armbian.list
|
||||
elif [[ $DOWNLOAD_MIRROR == "bfsu" ]]; then
|
||||
echo "deb http://mirrors.bfsu.edu.cn/armbian $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > "${SDCARD}"/etc/apt/sources.list.d/armbian.list
|
||||
else
|
||||
echo "deb http://"$([[ $BETA == yes ]] && echo "beta" || echo "apt" )".armbian.com $RELEASE main ${RELEASE}-utils ${RELEASE}-desktop" > "${SDCARD}"/etc/apt/sources.list.d/armbian.list
|
||||
fi
|
||||
@@ -1233,6 +1235,10 @@ function webseed ()
|
||||
WEBSEED=(
|
||||
"https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||
)
|
||||
elif [[ $DOWNLOAD_MIRROR == bfsu ]]; then
|
||||
WEBSEED=(
|
||||
"https://mirrors.bfsu.edu.cn/armbian-releases/"
|
||||
)
|
||||
fi
|
||||
for toolchain in ${WEBSEED[@]}; do
|
||||
# use only live, tnahosting return ok also when file is absent
|
||||
@@ -1256,9 +1262,11 @@ download_and_verify()
|
||||
local dirname=${filename//.tar.xz}
|
||||
|
||||
if [[ $DOWNLOAD_MIRROR == china ]]; then
|
||||
local server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||
else
|
||||
local server=${ARMBIAN_MIRROR}
|
||||
local server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||
elif [[ $DOWNLOAD_MIRROR == bfsu ]]; then
|
||||
local server="https://mirrors.bfsu.edu.cn/armbian-releases/"
|
||||
else
|
||||
local server=${ARMBIAN_MIRROR}
|
||||
fi
|
||||
|
||||
if [[ -f ${localdir}/${dirname}/.download-complete ]]; then
|
||||
@@ -1270,7 +1278,15 @@ download_and_verify()
|
||||
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
||||
display_alert "Timeout from $server" "retrying" "info"
|
||||
server="https://mirrors.tuna.tsinghua.edu.cn/armbian-releases/"
|
||||
|
||||
# switch to another china mirror if tuna timeouts
|
||||
timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename} 2>&1 >/dev/null
|
||||
if [[ $? -ne 7 && $? -ne 22 && $? -ne 0 ]]; then
|
||||
display_alert "Timeout from $server" "retrying" "info"
|
||||
server="https://mirrors.bfsu.edu.cn/armbian-releases/"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# check if file exists on remote server before running aria2 downloader
|
||||
[[ ! `timeout 10 curl --head --fail --silent ${server}${remotedir}/${filename}` ]] && return
|
||||
|
||||
Reference in New Issue
Block a user