From c3e34481018bc438baf68c2beb2da4177acdc713 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Tue, 2 Aug 2016 20:14:12 +0800 Subject: download iso from mirrorlist --- functions.sh | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'functions.sh') 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() { -- cgit v1.2.3