diff options
author | Erich Eckner <git@eckner.net> | 2019-01-16 10:10:56 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-16 10:10:56 +0100 |
commit | eae45b412c385a1d5941709fb7e843f381abf427 (patch) | |
tree | a946435dbdd129bf345944b390982fd213fb742e /checkVersions | |
parent | e3594e8a50e2c1e147c0911fd2607db69cd66cd3 (diff) | |
download | archlinuxewe-eae45b412c385a1d5941709fb7e843f381abf427.tar.xz |
checkVersions: do not remove temp-file unconditionally
Diffstat (limited to 'checkVersions')
-rwxr-xr-x | checkVersions | 8 |
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)" |