mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 13:30:02 +08:00
fix: Deduce mirror from URL
* fix: Deduce mirror from URL
This commit is contained in:
parent
ced994d94a
commit
70e10b1d56
@ -21,8 +21,19 @@ fi
|
|||||||
# Display wait message
|
# Display wait message
|
||||||
/run/server.sh 5000 install &
|
/run/server.sh 5000 install &
|
||||||
|
|
||||||
# Detect country
|
DL=""
|
||||||
COUNTRY=""
|
COUNTRY=""
|
||||||
|
DL_CHINA="https://cndl.synology.cn/download/DSM"
|
||||||
|
DL_GLOBAL="https://global.synologydownload.com/download/DSM"
|
||||||
|
|
||||||
|
[[ "${URL,,}" == *"cndl.synology"* ]] && DL="$DL_CHINA"
|
||||||
|
[[ "${URL,,}" == *"global.synology"* ]] && DL="$DL_GLOBAL"
|
||||||
|
|
||||||
|
if [ -z "$DL" ]; then
|
||||||
|
|
||||||
|
info "Install: Selecting download mirror..."
|
||||||
|
|
||||||
|
# Detect country
|
||||||
{ JSON=$(curl -sfk https://ipinfo.io/json); rc=$?; } || :
|
{ JSON=$(curl -sfk https://ipinfo.io/json); rc=$?; } || :
|
||||||
|
|
||||||
if (( rc == 0 )); then
|
if (( rc == 0 )); then
|
||||||
@ -40,13 +51,14 @@ fi
|
|||||||
|
|
||||||
# Select download mirror based on country
|
# Select download mirror based on country
|
||||||
if [ "$COUNTRY" == "CN" ]; then
|
if [ "$COUNTRY" == "CN" ]; then
|
||||||
DL="https://cndl.synology.cn/download/DSM"
|
DL="$DL_CHINA"
|
||||||
else
|
else
|
||||||
DL="https://global.synologydownload.com/download/DSM"
|
DL="$DL_GLOBAL"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Select default version based on architecture
|
|
||||||
if [ -z "$URL" ]; then
|
if [ -z "$URL" ]; then
|
||||||
|
# Select default version based on architecture
|
||||||
if [ "$ARCH" == "amd64" ]; then
|
if [ "$ARCH" == "amd64" ]; then
|
||||||
URL="$DL/release/7.2.1/69057-1/DSM_VirtualDSM_69057.pat"
|
URL="$DL/release/7.2.1/69057-1/DSM_VirtualDSM_69057.pat"
|
||||||
else
|
else
|
||||||
@ -68,6 +80,8 @@ rm -f "$STORAGE"/"$BASE".agent
|
|||||||
rm -f "$STORAGE"/"$BASE".boot.img
|
rm -f "$STORAGE"/"$BASE".boot.img
|
||||||
rm -f "$STORAGE"/"$BASE".system.img
|
rm -f "$STORAGE"/"$BASE".system.img
|
||||||
|
|
||||||
|
info "Install: Checking filesystem..."
|
||||||
|
|
||||||
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
[[ "${DEBUG}" == [Yy1]* ]] && set -x
|
||||||
|
|
||||||
# Check filesystem
|
# Check filesystem
|
||||||
|
Loading…
x
Reference in New Issue
Block a user