#!/bin/sh . ./.env || { echo ".env file not found or failed to load" exit 1 } mkdir -p "$DIR" wget -nc -nd -r -l1 --no-parent -A '*.pk3' -P "$DIR" "$URL" \ || { echo "wget not present, fallback to curl..." curl -s "$URL" \ | grep -o 'href="[^"]*\.pk3"' \ | cut -d'"' -f2 \ | while read -r f; do [ -f "$DIR/$f" ] || curl -# -o "$DIR/$f" "$URL/$f" done }