diff options
author | Erich Eckner <git@eckner.net> | 2019-01-03 10:31:24 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-03 10:31:24 +0100 |
commit | 8aa2bfebb9941482bf0665946d882c252f593a15 (patch) | |
tree | 6096c424a0b7be5ba86cc448648a906d809ad829 /checkVersions | |
parent | 9378a035f5f96264de6477af25b4f9dd33b50eba (diff) | |
download | archlinuxewe-8aa2bfebb9941482bf0665946d882c252f593a15.tar.xz |
checkVersions: use temporary file instead of sponge
Diffstat (limited to 'checkVersions')
-rwxr-xr-x | checkVersions | 10 |
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}" } |