PROXY="--proxy http://localhost:8080/" d=${1%/*} [ -z "$FEEDER_SKIP_DOWNLOAD" ] || { echo temporarily skipping feed download >&2 sha512 < $d/feed exit } read url < $d/url [ -s $d/etag ] && etag_compare="--etag-compare $d/etag" || etag_compare="" [ -z "$FEEDER_CURL_VERBOSE" ] && silent="--silent" || silent="--verbose" curl --fail \ --user-agent "go.stargrave.org-feeder/0.1.0" \ --compressed \ --location --max-redirs 2 \ --dump-header $d/hdr \ --output $d/out \ --remote-time \ --time-cond $d/out \ --etag-save $d/etag \ $PROXY \ $silent \ $etag_compare \ "$url" >&2 if [ -s $d/out ] ; then cp -a $d/out $d/feed truncate -s 0 $d/out touch -r $d/feed $d/out fi sha512 < $d/feed