This commit is contained in:
Kroese 2023-04-14 16:54:41 +02:00 committed by GitHub
parent 6b189a23f6
commit 9024296a2c

View File

@ -1,25 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -eu set -eu
IMG="/storage"
[ ! -d "$IMG" ] && echo "Storage folder (${IMG}) not found!" && exit 69 [ ! -d "$IMG" ] && echo "Storage folder (${IMG}) not found!" && exit 69
if [ -z $URL ]; then
if [ -f "$IMG"/dsm.ver ]; then
BASE=$(cat "${IMG}/dsm.ver")
else
# Fallback for old installs
BASE="DSM_VirtualDSM_42962"
fi
else
BASE=$(basename "$URL" .pat)
fi
[ ! -f "/run/server.sh" ] && echo "Script must run inside Docker container!" && exit 60
[ ! -f "$IMG/$BASE.boot.img" ] && rm -f "$IMG"/"$BASE".system.img
[ -f "$IMG/$BASE.system.img" ] && return
# Display wait message on port 5000 # Display wait message on port 5000
/run/server.sh 5000 > /dev/null & /run/server.sh 5000 > /dev/null &
@ -29,10 +12,10 @@ if [ -z $URL ]; then
#URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" #URL="https://global.synologydownload.com/download/DSM/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
#URL="https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat" #URL="https://global.synologydownload.com/download/DSM/release/7.1.1/42962-1/DSM_VirtualDSM_42962.pat"
BASE=$(basename "$URL" .pat)
fi fi
BASE=$(basename "$URL" .pat)
echo "Install: Downloading extractor..." echo "Install: Downloading extractor..."
TMP="$IMG/tmp" TMP="$IMG/tmp"