mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 21:40:01 +08:00
Refactor
This commit is contained in:
parent
6b189a23f6
commit
9024296a2c
21
install.sh
21
install.sh
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user