Replace wget use with curl

This commit is contained in:
FriendlyNeighborhoodShane 2020-07-07 22:04:25 +05:30
parent 2f89d2ebe1
commit 5eb99addd1

View File

@ -35,7 +35,7 @@ echo "-- From The MicroG Telegram group --";
echo "-- No, not the Official one --";
# Bin check
for bin in chmod cp curl grep head jq mv rm sort unzip wget; do
for bin in chmod cp curl grep head jq mv rm sort unzip; do
[ "$(which $bin)" ] || { echo " " >&2; echo "FATAL: No $bin found" >&2; return 1; }
done;
@ -93,7 +93,7 @@ for repo in $(echo "$stuff_repo" | select_word 1); do
repourl="$(echo "$line" | select_word 2)";
[ "$repourl" ] || { echo "ERROR: Repo $repo has no URL" >&2; continue; }
echo " -- REPO: Downloading repo $repo";
wget -q --show-progress "$repourl/index-v1.jar" -O "$tmpdir/repos/$repo.jar";
curl --progress-bar "$repourl/index-v1.jar" -o "$tmpdir/repos/$repo.jar";
[ -f "$tmpdir/repos/$repo.jar" ] || { echo "ERROR: Repo $repo failed to download" >&2; continue; }
unzip -oq "$tmpdir/repos/$repo.jar" "index-v1.json" -d "$tmpdir/repos/";
[ -f "$tmpdir/repos/index-v1.json" ] || { echo "ERROR: Repo $repo failed to unzip" >&2; continue; }
@ -163,7 +163,7 @@ for object in $(echo "$stuff_download" | select_word 1); do
objectname="$(basename "$objecturl")";
objectfile="$tmpdir/$objectname";
echo " ---- Downloading $objecturl";
wget -q --show-progress "$objecturl" -O "$objectfile" || { echo "ERROR: $object failed to download" >&2; continue; }
curl --progress-bar "$objecturl" -o "$objectfile" || { echo "ERROR: $object failed to download" >&2; continue; }
[ -f "$objectfile" ] || { echo "ERROR: $object failed to download" >&2; continue; }
echo "NAME: $objectname, FILE: $object, URL: $objecturl;" >> "$updatelog";
;;