diff --git a/scripts/dlscript_dop20.sh b/scripts/dlscript_dop20.sh index d357c50..b019d09 100644 --- a/scripts/dlscript_dop20.sh +++ b/scripts/dlscript_dop20.sh @@ -16,6 +16,12 @@ fi mkdir -p "$OUT_JP2" "$OUT_J2W" "$OUT_META" +DOP20_CURL_OPTS=() +if [[ "${DOP20_INSECURE:-}" == "1" ]]; then + DOP20_CURL_OPTS+=("-k") + echo "Warning: DOP20_INSECURE=1 set — skipping TLS verification." >&2 +fi + while IFS= read -r url; do [[ -z "$url" || "$url" =~ ^# ]] && continue fname="${url##*/}" @@ -30,7 +36,7 @@ while IFS= read -r url; do continue fi echo "Downloading $fname" - curl -fL "$url" -o "$dest" + curl -fL "${DOP20_CURL_OPTS[@]}" "$url" -o "$dest" done < "$LIST" echo "Done. Files in $OUT_JP2, $OUT_J2W, $OUT_META"