From 9024296a2c71f0669d17c1b2ea0690952c3a9050 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 14 Apr 2023 16:54:41 +0200 Subject: [PATCH] Refactor --- install.sh | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/install.sh b/install.sh index e84b6b1..900025f 100644 --- a/install.sh +++ b/install.sh @@ -1,25 +1,8 @@ #!/usr/bin/env bash set -eu -IMG="/storage" [ ! -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 /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.1.1/42962-1/DSM_VirtualDSM_42962.pat" - BASE=$(basename "$URL" .pat) - fi +BASE=$(basename "$URL" .pat) + echo "Install: Downloading extractor..." TMP="$IMG/tmp"