summaryrefslogtreecommitdiff
path: root/checkVersions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-29 13:20:18 +0100
committerErich Eckner <git@eckner.net>2019-01-29 13:20:18 +0100
commit4a29ae0ebac54ba67c7f1210fa30dbd4aa0e26d1 (patch)
tree671063dbd7d26c6e9d3caf1bdf9e7f41d15b89ab /checkVersions
parentc1a328a4a502a9831ab937554adeba165ce325a4 (diff)
downloadarchlinuxewe-4a29ae0ebac54ba67c7f1210fa30dbd4aa0e26d1.tar.xz
checkVersions: recognize "access denied" in answers
Diffstat (limited to 'checkVersions')
-rwxr-xr-xcheckVersions6
1 files changed, 5 insertions, 1 deletions
diff --git a/checkVersions b/checkVersions
index b371cf969..bcc857d43 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