From 7f93ac9bb6481e3e0ca80d7b4cf4ca2bb2d0d5b7 Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Sat, 10 Mar 2018 12:09:36 +0800 Subject: config file $HOME/.liveusb-builder, move isofiles to $ISOPATH and set default $ISOPATH location to $HOME/isofiles --- functions.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'functions.sh') diff --git a/functions.sh b/functions.sh index b1c804f..e57b72f 100644 --- a/functions.sh +++ b/functions.sh @@ -15,7 +15,7 @@ checksum_verify() { else fatalerror "Cannot find the SHA256, SHA1, or MD5 checksum of $ISOFILE" fi - _cksum=$("$_hashtool" "isofiles/$ISOFILE" | cut -d' ' -f1) + _cksum=$("$_hashtool" "$ISOPATH/$ISOFILE" | cut -d' ' -f1) if [[ $_cksum == $_hashsum ]]; then msg "$ISOFILE ok." else @@ -57,19 +57,19 @@ gen_grubcfg() { } download_iso() { - mkdir -p isofiles + mkdir -p "$ISOPATH" for url in ${mirrorlist[@]} do - wget -c -O "isofiles/$ISOFILE" "$url/$ISOURL" + wget -c -O "$ISOPATH/$ISOFILE" "$url/$ISOURL" if checksum_verify; then return 0 else # checksum bad, may be due to a bad partial download # so remove the file and try again - rm -f "isofiles/$ISOFILE" - wget -O "isofiles/$ISOFILE" "$url/$ISOURL" + rm -f "$ISOPATH/$ISOFILE" + wget -O "$ISOPATH/$ISOFILE" "$url/$ISOURL" checksum_verify && return 0 - rm -f "isofiles/$ISOFILE" # then try next mirror + rm -f "$ISOPATH/$ISOFILE" # then try next mirror fi done fatalerror "Fail to download $ISOFILE!" @@ -80,7 +80,7 @@ mount_iso() { then umount_iso fi - udevil mount "isofiles/$ISOFILE" "$ISOMNT" + udevil mount "$ISOPATH/$ISOFILE" "$ISOMNT" } umount_iso() { -- cgit v1.2.3