summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-16 10:10:56 +0100
committerErich Eckner <git@eckner.net>2019-01-16 10:10:56 +0100
commiteae45b412c385a1d5941709fb7e843f381abf427 (patch)
treea946435dbdd129bf345944b390982fd213fb742e
parente3594e8a50e2c1e147c0911fd2607db69cd66cd3 (diff)
downloadarchlinuxewe-eae45b412c385a1d5941709fb7e843f381abf427.tar.xz
checkVersions: do not remove temp-file unconditionally
-rwxr-xr-xcheckVersions8
1 files changed, 5 insertions, 3 deletions
diff --git a/checkVersions b/checkVersions
index c8abf1e1a..8a5d9a512 100755
--- a/checkVersions
+++ b/checkVersions
@@ -36,12 +36,14 @@ curl_it() {
fi
cat "${tmp_file}"
local trials=5
- while ! mv "${tmp_file}" "${cache_file}" && \
- [ ${trials} -gt 0 ]; do
+ while [ ${trials} -gt 0 ] && \
+ ! mv "${tmp_file}" "${cache_file}"; do
sleep 1
trials=$((trials-1))
done
- rm -f "${tmp_file}"
+ if [ ${trials} -le 0 ]; then
+ rm -f "${tmp_file}"
+ fi
}
me="$(readlink -f $0)"