From a62477a2853138b16a15a3b6ccc34c92ce37c29c Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Thu, 15 Sep 2016 09:47:19 +0800 Subject: submenu for ISOs that have multiple entries --- functions.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'functions.sh') diff --git a/functions.sh b/functions.sh index 664aa24..c533e07 100644 --- a/functions.sh +++ b/functions.sh @@ -23,8 +23,12 @@ checksum_verify() { fi } +# process_isoinfo +# loads $DISTRONAME $ISONAME $ISOFILE $ISOURL process_isoinfo() { unset MD5 SHA1 SHA256 SHA512 + _distrobase="distro/$(cut -d'/' -f1 <<< "$1")" + source "$_distrobase/distroinfo" source "distro/$1/isoinfo" ISOFILE="$(basename $ISOURL)" } @@ -38,11 +42,18 @@ process_distro() { } gen_grubcfg() { - local entry - for entry in "distro/$1/entry"* + local entry allentries + allentries=("distro/$1/entry"*) + if [ ${#allentries[@]} -gt 1 ]; then + echo "submenu '$ISONAME' {" + fi + for entry in "${allentries[@]}" do UUID="$UUID" ISOFILE="$ISOFILE" ./mkgrubcfg.sh "$entry" done + if [ ${#allentries[@]} -gt 1 ]; then + echo '}' + fi } download_iso() { -- cgit v1.2.3