summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-03 14:53:14 +0100
committerErich Eckner <git@eckner.net>2019-01-03 14:53:14 +0100
commit03e6ac41e93c318bd7ce89266194276a4c006cb4 (patch)
tree0a3fd8a446604cfd5e68df9f2ecdd8522dbb122d
parent2902df63b498b9e2c77e21e7440a3cb4cc419a2a (diff)
downloadarchlinuxewe.git.save-03e6ac41e93c318bd7ce89266194276a4c006cb4.tar.xz
checkVersions: try to move temp file 5 times, remove residual file if non-successful
-rwxr-xr-xcheckVersions8
1 files changed, 7 insertions, 1 deletions
diff --git a/checkVersions b/checkVersions
index 79fe2724..835ae170 100755
--- a/checkVersions
+++ b/checkVersions
@@ -34,7 +34,13 @@ curl_it() {
if [ ! -s "${tmp_file}" ]; then
curl --compressed -o "${tmp_file}" --connect-timeout 10 -s -x socks5://127.0.0.1:9050 "$@" "${source}"
fi
- mv "${tmp_file}" "${cache_file}"
+ local trials=5
+ while ! mv "${tmp_file}" "${cache_file}" && \
+ [ ${trials} -gt 0 ]; do
+ sleep 1
+ trials=$((trials-1))
+ done
+ rm -f "${tmp_file}"
cat "${cache_file}"
}