This commit is contained in:
Stephen Simpson
2025-11-26 08:15:00 -06:00
parent 3cbd4525a0
commit bb829c9b63
18 changed files with 2440 additions and 349 deletions

22
scripts/download-image.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
URL="$1"
OUTPUT_DIR="${2:-/var/lib/libvirt/images}"
FORCE="${3:-false}"
if [ -z "$URL" ]; then
echo "Usage: $0 <url> [output_dir] [force]"
exit 1
fi
FILENAME=$(basename "$URL")
CACHED="$OUTPUT_DIR/$FILENAME"
if [ "$FORCE" = "true" ] || [ ! -f "$CACHED" ]; then
echo "Downloading $URL to $CACHED"
curl -L --progress-bar -o "$CACHED" "$URL"
else
echo "Using cached image: $CACHED"
fi
echo "$CACHED"