From 4a29ae0ebac54ba67c7f1210fa30dbd4aa0e26d1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 29 Jan 2019 13:20:18 +0100 Subject: checkVersions: recognize "access denied" in answers --- checkVersions | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'checkVersions') diff --git a/checkVersions b/checkVersions index b371cf96..bcc857d4 100755 --- a/checkVersions +++ b/checkVersions @@ -25,12 +25,16 @@ curl_it() { shift cache_file="${curl_cache}/${cache_file}" if [ -s "${cache_file}" ] && \ - [ $(stat -c%Y "${cache_file}") -gt $(($(date +%s)-300)) ]; then + [ $(stat -c%Y "${cache_file}") -gt $(($(date +%s)-300)) ] && + ! grep -qiF 'access denied' "${cache_file}"; then cat "${cache_file}" return fi tmp_file=$(mktemp) curl --compressed -o "${tmp_file}" --connect-timeout 10 -s -x socks5://127.0.0.1:9050 "$@" "${source}" + if grep -qiF 'access denied' "${tmp_file}"; then + : >"${tmp_file}" + fi if [ ! -s "${tmp_file}" ]; then curl --compressed -o "${tmp_file}" --connect-timeout 10 -s "$@" "${source}" fi -- cgit v1.2.3-70-g09d2