update migration tool url

This commit is contained in:
link 2023-01-05 03:36:45 +00:00
parent 856c5aeb48
commit 13b6091c79
2 changed files with 18 additions and 3 deletions

View File

@ -56,6 +56,21 @@ __is_migration_needed() {
__is_version_gt "${version2}" "${version1}"
}
__get_download_domain(){
local region
# Use ipconfig.io/country and https://ifconfig.io/country_code to get the country code
region=$(curl --connect-timeout 2 -s ipconfig.io/country || echo "")
if [ "${region}" = "" ]; then
region=$(curl --connect-timeout 2 -s https://ifconfig.io/country_code || echo "")
fi
if [[ "${region}" = "China" ]] || [[ "${region}" = "CN" ]]; then
echo "https://casaos.oss-cn-shanghai.aliyuncs.com/"
else
echo "https://github.com/"
fi
}
DOWNLOAD_DOMAIN=$(__get_download_domain)
BUILD_PATH=$(dirname "${BASH_SOURCE[0]}")/../../..

View File

@ -1,3 +1,3 @@
LEGACY_WITHOUT_VERSION https://github.com/IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz
v0.3.5 https://github.com/IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz
v0.3.5.1 https://github.com/IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz
LEGACY_WITHOUT_VERSION ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz
v0.3.5 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz
v0.3.5.1 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS-UserService/releases/download/v0.3.6/linux-${ARCH}-casaos-user-service-migration-tool-v0.3.6.tar.gz