diff --git a/pre-download.sh b/pre-download.sh new file mode 100644 index 0000000..a8c422c --- /dev/null +++ b/pre-download.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Ensure script is run as root (required for apt + /etc) +if [[ "$EUID" -ne 0 ]]; then + echo "Please run as root (or use sudo)." >&2 + exit 1 +fi + +#set script directory +scriptdir="$(dirname "$(realpath "$0")")" + +# Capture the start time (Unix timestamp) +START_TIME=$(date +%s) + +echo "Updating apt and installing prerequisites..." +apt update +apt install -y ca-certificates curl git openssl curl gawk coreutils grep jq sqlite3 iso-codes + +echo "Setting up Docker GPG key..." +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ + -o /etc/apt/keyrings/docker.asc +chmod a+r /etc/apt/keyrings/docker.asc + +echo "Adding Docker apt repository..." +. /etc/os-release + +cat > /etc/apt/sources.list.d/docker.sources <