http_get_aria2c should return proper value on aria2c failures

This commit is contained in:
Yamashita, Yuu 2016-06-02 01:43:57 +00:00
parent 42cffbc82d
commit 4d64f84a25

View file

@ -341,8 +341,11 @@ http_head_aria2c() {
http_get_aria2c() {
local out="${2:-$(mktemp "out.XXXXXX")}"
aria2c --allow-overwrite=true -o "${out}" ${ARIA2_OPTS} "$1" >&4
[ -n "$2" ] || cat "${out}"
if aria2c --allow-overwrite=true -o "${out}" ${ARIA2_OPTS} "$1" >&4; then
[ -n "$2" ] || cat "${out}"
else
false
fi
}
http_head_curl() {