summaryrefslogtreecommitdiff
path: root/functions.sh
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-03-10 12:09:36 +0800
committerIru Cai <mytbk920423@gmail.com>2018-03-10 12:37:47 +0800
commit7f93ac9bb6481e3e0ca80d7b4cf4ca2bb2d0d5b7 (patch)
treed4cca1224a9cad90b1b2222529abb31d90764ba7 /functions.sh
parent56f19f7fc19c861e18efa152790d62b9c635d292 (diff)
downloadliveusb-builder-7f93ac9bb6481e3e0ca80d7b4cf4ca2bb2d0d5b7.tar.xz
config file $HOME/.liveusb-builder, move isofiles to $ISOPATH
and set default $ISOPATH location to $HOME/isofiles
Diffstat (limited to 'functions.sh')
-rw-r--r--functions.sh14
1 files changed, 7 insertions, 7 deletions
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() {