From 3e6903ae284ebf615ad1fedab7a76caf8f2a5395 Mon Sep 17 00:00:00 2001 From: lemniskett Date: Sat, 23 Jan 2021 15:43:17 +0700 Subject: [PATCH 1/2] Add more support for other downloaders. --- archbox.bash | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/archbox.bash b/archbox.bash index aaa103b..22dc8d1 100644 --- a/archbox.bash +++ b/archbox.bash @@ -39,6 +39,18 @@ OPTIONS: EOF } +fetch_tarball(){ + if hash aria2c 2>/dev/null; then + aria2c -o archlinux.tar.gz $1 + elif hash wget 2>/dev/null; then + wget -O archlinux.tar.gz $1 + elif hash curl 2>/dev/null; then + curl -o archlinux.tar.gz $1 + else + err "No supported downloader found." + fi +} + err(){ echo "$(tput bold)$(tput setaf 1)==> $@ $(tput sgr0)" 1>&2 exit 1 @@ -57,7 +69,7 @@ case $1 in cd $INSTALL_PATH msg "Downloading Arch Linux tarball..." checkdep wget - while true; do wget -O archlinux.tar.gz $2 && break; done + while true; do fetch_tarball $2 && break; done msg "Extracting the tarball..." checkdep tar tar xzf archlinux.tar.gz From 9162f96fcd06ff95a5b56e357acc60e7232e9074 Mon Sep 17 00:00:00 2001 From: lemniskett Date: Sat, 23 Jan 2021 15:48:31 +0700 Subject: [PATCH 2/2] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a42f826..6ecdf20 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ Ever since I'm running some niche distros like Void, Solus, I had a problem find ### Dependencies - Bash - Sed -- Wget +- Curl +- Wget (Optional: use ```wget``` when it's installed) +- Aria2 (Optional: use ```aria2c``` when it's installed) - Tar - Desktop-file-utils - Xorg-xhost (Optional: allowing users in Archbox to access X server)