Wget use -c flag in download for resuming
This commit is contained in:
parent
b45d5bfbed
commit
8cb126af3b
1 changed files with 2 additions and 7 deletions
9
init.sh
9
init.sh
|
@ -109,15 +109,10 @@ download (){
|
||||||
# $2 : url
|
# $2 : url
|
||||||
# $3 : 1 if abort download if file exist
|
# $3 : 1 if abort download if file exist
|
||||||
printf "Downloading %s : " "$1"
|
printf "Downloading %s : " "$1"
|
||||||
if [[ -f $1 && $3 == "1" ]]
|
wget -c --progress=dot $2/$1 2>&1 | grep --line-buffered "[0-9]\{1,3\}%" -o | awk '{printf ("\b\b\b\b%4s", $1)}'
|
||||||
then
|
|
||||||
printf "\b\b\b\bfile already downloaded.\n"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
wget --no-clobber --progress=dot $2/$1 2>&1 | grep --line-buffered "[0-9]\{1,3\}%" -o | awk '{printf ("\b\b\b\b%4s", $1)}'
|
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
then
|
then
|
||||||
printf " done\n "
|
printf " \b\b\b\bdone\n "
|
||||||
else
|
else
|
||||||
printf " error, exiting.\n"
|
printf " error, exiting.\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Reference in a new issue