allow feed configs to overwrite proxy command

This commit is contained in:
Albert S. 2017-08-11 16:42:37 +02:00
parent 7d664e4752
commit b01b396783
1 changed files with 6 additions and 2 deletions

View File

@ -39,7 +39,7 @@ while true ; do
fi
fetcher="$FEED_FETCHER"
if [ -z "$FEED_FETCHER" ] ; then
if [ -z "$fetcher" ] ; then
fetcher=$( shuf -n 1 "$fetchersfile" )
fi
@ -48,10 +48,14 @@ while true ; do
exit 1
fi
proxycommand="$FEED_PROXYCOMMAND"
if [ -z "$proxycommand" ] ; then
proxycommand="torsocks"
fi
[ $syncnow -eq 1 ] || ( echo "Sleeping for $sleepfor seconds for $url, chosen fetcher $fetcher" && sleep "$sleepfor" )
echo "Fetching $FEED_URL with $fetcher"
torsocks "$fetcher" "$FEED_URL" "$FEED_OUTPUT" || echo "Failed to fetch $FEED_URL"
"$proxycommand" "$fetcher" "$FEED_URL" "$FEED_OUTPUT" || echo "Failed to fetch $FEED_URL"
done
[ $syncnow -eq 1 ] && exit
done