diff options
-rwxr-xr-x | buildlive | 3 | ||||
-rw-r--r-- | functions.sh | 9 |
2 files changed, 11 insertions, 1 deletions
@@ -65,7 +65,8 @@ do if [ -f "isofiles/$ISOFILE" ]; then checksum_verify else - fatalerror "File isofiles/$ISOFILE not found!" + download_iso + checksum_verify fi install_live diff --git a/functions.sh b/functions.sh index e44b8a7..8d8db9c 100644 --- a/functions.sh +++ b/functions.sh @@ -25,6 +25,15 @@ process_distro() { source "distro/$1/install.sh" ISOFILE="$(basename $ISOURL)" ISOMNT="/media/$ISOFILE" + MIRRORLIST=(`cat "distro/$1/mirrorlist"`) +} + +download_iso() { + for url in ${MIRRORLIST[@]} + do + wget -O "isofiles/$ISOFILE" "$url/$ISOURL" && return 0 + done + fatalerror "Fail to download $ISOFILE!" } mount_iso() { |