mirror of
git://github.com/lxc/lxc
synced 2025-08-31 02:17:58 +00:00
download: Have wget retry 3 times
This forces wget to retry if it gets a network error. Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
@@ -69,9 +69,19 @@ cleanup() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wget_wrapper() {
|
||||||
|
for i in $(seq 3); do
|
||||||
|
if wget $@; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
download_file() {
|
download_file() {
|
||||||
if ! wget -T 30 -q https://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
|
if ! wget_wrapper -T 30 -q https://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
|
||||||
if ! wget -T 30 -q http://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
|
if ! wget_wrapper -T 30 -q http://${DOWNLOAD_SERVER}/$1 -O $2 >/dev/null 2>&1; then
|
||||||
if [ "$3" = "noexit" ]; then
|
if [ "$3" = "noexit" ]; then
|
||||||
return 1
|
return 1
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user