#!/bin/bash # Change to the script's directory cd "$(dirname "$0")" ISO_URL="https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.9.0-amd64-DVD-1.iso" IMAGE_DIR="images" ISO_NAME="$IMAGE_DIR/debian-server.iso" SOURCE_DIR="source" # Create necessary directories mkdir -p "$IMAGE_DIR" "$SOURCE_DIR" # Download the ISO file wget -O "$ISO_NAME" "$ISO_URL" # Extract ISO contents xorriso -osirrox on -indev "$ISO_NAME" -extract / "$SOURCE_DIR/" echo "Debian server ISO file downloaded to $IMAGE_DIR and extracted to $SOURCE_DIR"