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

View File

@ -39,7 +39,7 @@ while true ; do
fi fi
fetcher="$FEED_FETCHER" fetcher="$FEED_FETCHER"
if [ -z "$FEED_FETCHER" ] ; then if [ -z "$fetcher" ] ; then
fetcher=$( shuf -n 1 "$fetchersfile" ) fetcher=$( shuf -n 1 "$fetchersfile" )
fi fi
@ -48,10 +48,14 @@ while true ; do
exit 1 exit 1
fi 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" ) [ $syncnow -eq 1 ] || ( echo "Sleeping for $sleepfor seconds for $url, chosen fetcher $fetcher" && sleep "$sleepfor" )
echo "Fetching $FEED_URL with $fetcher" 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 done
[ $syncnow -eq 1 ] && exit [ $syncnow -eq 1 ] && exit
done done