Skip to content

Commit

Permalink
downloader in parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitre committed Mar 10, 2024
1 parent c11edef commit 6e8819c
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions scripts/dev/downloader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,37 @@ EOF
}

downloader() {

if [ -z "$1" ]
then printDownloaderHelp; fi

SILENTARGS="";
if [ $# -ge 2 ]; then
SILENTARGS=$2
fi
if [[ "${SILENTARGS}" == "-s" ]]; then
if command -v curl 2>/dev/null; then
curl -LO --retry 20 -O -s $@;
else
wget -q $@ 2> /dev/null; fi;
SILENTARGS="";
if [ $# -ge 2 ]; then
SILENTARGS=$2
fi
if [[ "${SILENTARGS}" == "-s" ]]; then
if command -v wget2 2>/dev/null; then
wget2 -q $@;
elif command -v curl 2>/dev/null; then
for PKG in $@; do
curl -LO --retry 20 -O -s $PKG;
done
else
for PKG in $@; do
wget -q $PKG@ 2> /dev/null;
done
fi;
else
if command -v curl 2>/dev/null; then
curl -LO --retry 20 -O --progress-bar $@;
else
wget $@ 2> /dev/null; fi;
if command -v wget2 2>/dev/null; then
wget2 $@;
elif command -v curl 2>/dev/null; then
for PKG in $@; do
curl -LO --retry 20 -O --progress-bar $PKG;
done
else
for PKG in $@; do
wget $PKG 2> /dev/null;
done
fi;
fi


Expand Down

0 comments on commit 6e8819c

Please sign in to comment.