#!/usr/bin/env bash # Download DOP20 assets (JP2/J2W/XML) listed line-by-line in raw/dop20/filelist.txt. set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" DOP_ROOT="$ROOT/raw/dop20" LIST="${LIST:-$DOP_ROOT/filelist.txt}" OUT="$DOP_ROOT/jp2" if [[ ! -f "$LIST" ]]; then echo "Missing filelist: $LIST" >&2 exit 1 fi mkdir -p "$OUT" while IFS= read -r url; do [[ -z "$url" || "$url" =~ ^# ]] && continue fname="${url##*/}" dest="$OUT/$fname" if [[ -f "$dest" ]]; then echo "Exists: $fname" continue fi echo "Downloading $fname" curl -fL "$url" -o "$dest" done < "$LIST" echo "Done. Files in $OUT"