mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-12-23 13:04:42 +00:00
Compare commits
2 Commits
v0.4.1-alp
...
v0.4.1-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9946db854 | ||
|
|
9eb650b444 |
@@ -56,6 +56,22 @@ __is_migration_needed() {
|
|||||||
__is_version_gt "${version2}" "${version1}"
|
__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]}")/../../..
|
BUILD_PATH=$(dirname "${BASH_SOURCE[0]}")/../../..
|
||||||
SOURCE_ROOT=${BUILD_PATH}/sysroot
|
SOURCE_ROOT=${BUILD_PATH}/sysroot
|
||||||
|
|
||||||
@@ -143,7 +159,8 @@ fi
|
|||||||
|
|
||||||
pushd "${MIGRATION_SERVICE_DIR}"
|
pushd "${MIGRATION_SERVICE_DIR}"
|
||||||
|
|
||||||
{ for URL in "${MIGRATION_PATH[@]}"; do
|
{
|
||||||
|
for URL in "${MIGRATION_PATH[@]}"; do
|
||||||
MIGRATION_TOOL_FILE=$(basename "${URL}")
|
MIGRATION_TOOL_FILE=$(basename "${URL}")
|
||||||
|
|
||||||
if [ -f "${MIGRATION_TOOL_FILE}" ]; then
|
if [ -f "${MIGRATION_TOOL_FILE}" ]; then
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
LEGACY_WITHOUT_VERSION https://github.com/IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
LEGACY_WITHOUT_VERSION ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
||||||
v0.3.5 https://github.com/IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
v0.3.5 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
||||||
v0.3.5.1 https://github.com/IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
v0.3.5.1 ${DOWNLOAD_DOMAIN}IceWhaleTech/CasaOS/releases/download/v0.3.6/linux-${ARCH}-casaos-migration-tool-v0.3.6.tar.gz
|
||||||
@@ -232,6 +232,8 @@ func (c *systemService) GetNet(physics bool) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *systemService) UpdateSystemVersion(version string) {
|
func (s *systemService) UpdateSystemVersion(version string) {
|
||||||
|
keyName := "casa_version"
|
||||||
|
Cache.Delete(keyName)
|
||||||
if file.Exists(config.AppInfo.LogPath + "/upgrade.log") {
|
if file.Exists(config.AppInfo.LogPath + "/upgrade.log") {
|
||||||
os.Remove(config.AppInfo.LogPath + "/upgrade.log")
|
os.Remove(config.AppInfo.LogPath + "/upgrade.log")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user