summaryrefslogtreecommitdiff
path: root/checkVersions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-03 10:31:24 +0100
committerErich Eckner <git@eckner.net>2019-01-03 10:31:24 +0100
commit8aa2bfebb9941482bf0665946d882c252f593a15 (patch)
tree6096c424a0b7be5ba86cc448648a906d809ad829 /checkVersions
parent9378a035f5f96264de6477af25b4f9dd33b50eba (diff)
downloadarchlinuxewe-8aa2bfebb9941482bf0665946d882c252f593a15.tar.xz
checkVersions: use temporary file instead of sponge
Diffstat (limited to 'checkVersions')
-rwxr-xr-xcheckVersions10
1 files changed, 5 insertions, 5 deletions
diff --git a/checkVersions b/checkVersions
index c22814eb2..9f9ca9a56 100755
--- a/checkVersions
+++ b/checkVersions
@@ -29,12 +29,12 @@ curl_it() {
cat "${cache_file}"
return
fi
- curl --compressed --connect-timeout 10 -s "$@" "${source}" \
- | sponge "${cache_file}"
- if [ ! -s "${cache_file}" ]; then
- curl --compressed --connect-timeout 10 -s -x socks5://127.0.0.1:9050 "$@" "${source}" \
- | sponge "${cache_file}"
+ tmp_file=$(mktemp)
+ curl --compressed -o "${tmp_file}" --connect-timeout 10 -s "$@" "${source}"
+ 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}"
cat "${cache_file}"
}