From 8f4feae8ef1f456a8ab63efac2089e94f0ee41b4 Mon Sep 17 00:00:00 2001 From: squidbear <379651+czarly@users.noreply.github.com> Date: Mon, 31 Mar 2025 10:30:43 +0200 Subject: [PATCH] do the snap thing --- thundercore/scripts/download.thunder.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 thundercore/scripts/download.thunder.sh diff --git a/thundercore/scripts/download.thunder.sh b/thundercore/scripts/download.thunder.sh new file mode 100644 index 00000000..1dd23002 --- /dev/null +++ b/thundercore/scripts/download.thunder.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Exit on error and show commands +set -ex + +# Verify snapshot URL is provided +if [ -z "$SNAPSHOT_URL" ]; then + echo "Error: SNAPSHOT_URL environment variable not set" + exit 1 +fi + +# Install required tools +apk add --no-cache wget tar gzip + +# Create and prepare directories +rm -rf /datadir/* + +url=$(wget -q -O - $SNAPSHOT_URL) +echo "downloading $url" + +wget --show-progress -c $url -O - | tar -C /datadir -zx + +echo "Download and extraction complete"