#!/bin/sh -e
-PROXY="--proxy http://localhost:8080/"
+cmds="$(dirname "$(realpath -- "$0")")"
+. "$cmds/env.rc"
cd "$1"
read url < url
[ -s etag ] && etag_compare="--etag-compare etag" || :
[ -r out ] && time_cond="--time-cond out" || :
[ -z "$FEEDER_CURL_VERBOSE" ] && silent="--silent" || silent="--verbose"
-curl --fail \
- --user-agent "go.stargrave.org-feeder/0.1.0" \
+${CURL:-curl} --fail \
+ --user-agent "$FEEDER_USER_AGENT" \
--compressed \
--location --max-redirs 2 \
--dump-header hdr \
--output out \
--remote-time \
--etag-save etag \
- $PROXY \
$etag_compare \
$time_cond \
$silent \
"$url" >&2
if [ -s out ] ; then
- zstdmt -19 < out > feed.zst
+ $ZSTD < out > feed.zst
touch -r out feed.zst
truncate -s 0 out
touch -r feed.zst out
fi
-sha512 < feed.zst > download.hash
+$SHA512 < feed.zst > download.hash