Improve cache and toolchain download (#2665)

* Improve cache and toolchain download

* Cleanup
This commit is contained in:
Igor Pečovnik
2021-02-26 18:27:21 +01:00
committed by GitHub
parent 9dd16212e1
commit 2e594375a9
3 changed files with 31 additions and 9 deletions

View File

@@ -497,7 +497,13 @@ if [[ $DOWNLOAD_MIRROR == china ]] ; then
UBUNTU_MIRROR='mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/'
fi
ARMBIAN_MIRROR='https://redirect.armbian.com'
# don't use mirrors that throws garbage on 404
while true; do
ARMBIAN_MIRROR=$(wget -SO- -T 1 -t 1 https://redirect.armbian.com 2>&1 | egrep -i "Location" | awk '{print $2}')
[[ ${ARMBIAN_MIRROR} != *armbian.hosthatch* ]] && break
done
# For user override
if [[ -f $USERPATCHES_PATH/lib.config ]]; then