From ad5be3900d76c9a790489f8db8a1860af1686aa8 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 8 May 2023 13:41:25 +0200 Subject: [PATCH 1/4] Update download location --- run/install.sh | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/run/install.sh b/run/install.sh index f59b1d4..6634e2f 100644 --- a/run/install.sh +++ b/run/install.sh @@ -22,28 +22,40 @@ fi BASE=$(basename "$URL" .pat) +rm -f "$STORAGE"/dsm.ver rm -f "$STORAGE"/"$BASE".pat rm -f "$STORAGE"/"$BASE".agent rm -f "$STORAGE"/"$BASE".boot.img rm -f "$STORAGE"/"$BASE".system.img -echo "Install: Downloading extractor..." - TMP="$STORAGE/tmp" RD="$TMP/rd.gz" +RDC="$STORAGE/dsm.rd" + rm -rf "$TMP" && mkdir -p "$TMP" [[ "${DEBUG}" == [Yy1]* ]] && set -x -LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" +if [ ! -f "${RDC}" ]; then -{ curl -r 64493568-69886247 -sfk -o "$RD" "$LOC"; rc=$?; } || : -(( rc != 0 )) && echo "ERROR: Failed to download $LOC, reason: $rc" && exit 60 + echo "Install: Downloading installer..." + LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" -SUM=$(md5sum "$RD" | cut -f 1 -d " ") + { curl -r 65627648-71021836 -sfk -o "$RD" "$LOC"; rc=$?; } || : + (( rc != 0 )) && echo "ERROR: Failed to download $LOC, reason: $rc" && exit 60 -if [ "$SUM" != "14fb88cb7cabddb5af1d0269bf032845" ]; then - echo "ERROR: Invalid file, checksum mismatch: $SUM" && exit 61 + SUM=$(md5sum "$RD" | cut -f 1 -d " ") + + if [ "$SUM" != "ab399db750f88ac7aa88f608f2b8651c" ]; then + echo "ERROR: Invalid download location (checksum $SUM)" && exit 61 + fi + + cp "$RD" "$RDC" + +else + + cp "$RDC" "$RD" + fi set +e From 806cfcf874f36b434581c07d20095974e9d72e62 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 8 May 2023 13:45:06 +0200 Subject: [PATCH 2/4] Update download location --- run/install.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/run/install.sh b/run/install.sh index 6634e2f..3148d86 100644 --- a/run/install.sh +++ b/run/install.sh @@ -29,7 +29,6 @@ rm -f "$STORAGE"/"$BASE".boot.img rm -f "$STORAGE"/"$BASE".system.img TMP="$STORAGE/tmp" -RD="$TMP/rd.gz" RDC="$STORAGE/dsm.rd" rm -rf "$TMP" && mkdir -p "$TMP" @@ -38,6 +37,7 @@ rm -rf "$TMP" && mkdir -p "$TMP" if [ ! -f "${RDC}" ]; then + RD="$TMP/rd.gz" echo "Install: Downloading installer..." LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat" @@ -52,14 +52,10 @@ if [ ! -f "${RDC}" ]; then cp "$RD" "$RDC" -else - - cp "$RDC" "$RD" - fi set +e -xz -dc <"$RD" >"$TMP/rd" 2>/dev/null || true +xz -dc <"$RDC" >"$TMP/rd" 2>/dev/null || true (cd "$TMP" && cpio -idm <"$TMP/rd" 2>/dev/null) set -e From 06e4cb92e0783ce9a1e12aaf191b5017c2979ebd Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 8 May 2023 13:47:00 +0200 Subject: [PATCH 3/4] Update download location --- run/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run/install.sh b/run/install.sh index 3148d86..7388dc1 100644 --- a/run/install.sh +++ b/run/install.sh @@ -49,9 +49,9 @@ if [ ! -f "${RDC}" ]; then if [ "$SUM" != "ab399db750f88ac7aa88f608f2b8651c" ]; then echo "ERROR: Invalid download location (checksum $SUM)" && exit 61 fi - + cp "$RD" "$RDC" - + fi set +e From 8f32bc2ea1f940e0a2c21e41933069a255295033 Mon Sep 17 00:00:00 2001 From: Kroese Date: Mon, 8 May 2023 13:52:47 +0200 Subject: [PATCH 4/4] Update download location --- run/install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run/install.sh b/run/install.sh index 7388dc1..c153507 100644 --- a/run/install.sh +++ b/run/install.sh @@ -22,7 +22,6 @@ fi BASE=$(basename "$URL" .pat) -rm -f "$STORAGE"/dsm.ver rm -f "$STORAGE"/"$BASE".pat rm -f "$STORAGE"/"$BASE".agent rm -f "$STORAGE"/"$BASE".boot.img