Check if file exists on remote server before running aria2 downloader (#2435)

This commit is contained in:
Igor Pečovnik 2020-12-10 16:14:50 +01:00 committed by GitHub
parent 7907a502a3
commit ecab2ce68b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1202,6 +1202,9 @@ download_and_verify()
return
fi
# check if file exists on remote server before running aria2 downloader
[[ ! `wget -S --spider ${server}${remotedir}/${filename} 2>&1 | grep 'HTTP/1.1 200 OK'` ]] && return
cd "${localdir}" || exit
# use local control file