diff options
author | kaa <kaa@disroot.org> | 2025-07-13 14:52:47 -0700 |
---|---|---|
committer | kaa <kaa@disroot.org> | 2025-07-13 14:52:47 -0700 |
commit | 09351a174296c4ccc964501198db79125fcc00cf (patch) | |
tree | 9610f74fbfe0c0f0ae89c7cc5ed399461ea896bf | |
parent | 20884258dfb5ff87bd0416899289480ec7d0fc31 (diff) |
-rwxr-xr-x | concurrent_dl.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/concurrent_dl.sh b/concurrent_dl.sh index d2c9d36..b44b3d0 100755 --- a/concurrent_dl.sh +++ b/concurrent_dl.sh @@ -4,9 +4,9 @@ chunk=10 dl_safe() { echo "$1 <- $2" - if (echo $1 | grep '/' >/dev/null) && ! [ -d ${1%/*} ] + if (echo $1 | grep '/' >/dev/null) && ! [ -d "${1%/*}" ] then - mkdir -p ${1%/*} + mkdir -p "${1%/*}" fi @@ -15,7 +15,7 @@ dl_safe() limit=10 while [ $done -ne 0 ] && [ $i -lt $limit ] do - curl --compressed --max-time 10 -sLo $1 $2 -H @$3 + curl --compressed --max-time 10 -sLo "$1" "$2" -H "@$3" done=$? i=$((i+1)) done @@ -43,9 +43,9 @@ strip_path() fi ) - if ! [ -d $outdir ] + if ! [ -d "$outdir" ] then - mkdir -p $outdir + mkdir -p "$outdir" fi } concurrent_dl() @@ -98,9 +98,9 @@ concurrent_dl() pids="" read url o=$(echo "$url" | $filter) - if ! [ -f $o ] + if ! [ -f "$o" ] then - dl_safe $o $url $headers & + dl_safe "$o" "$url" "$headers" & pids="$pids $!" fi i=$((i+1)) |