summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2020-07-01 22:51:45 +0800
committerIru Cai <mytbk920423@gmail.com>2020-07-01 22:51:45 +0800
commit3184448efe5c7ce4c8be20161d85f551a136168c (patch)
treeb05b9a957bfae95fb95f20f03d80d1b0a77d37a1
parent6a20507f950483f2adc68bab42a22bf5e7e8c683 (diff)
downloadliveusb-builder-3184448efe5c7ce4c8be20161d85f551a136168c.tar.xz
add get_iso_label function which is useful for some iso files
-rw-r--r--functions.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index aae9089..dba6d9d 100644
--- a/functions.sh
+++ b/functions.sh
@@ -109,6 +109,12 @@ download_iso() {
fatalerror "Fail to download $ISOFILE!"
}
+get_iso_label() {
+ # the label of an ISO file is between two quote symbols
+ # of the file(1) output
+ file -b "$1" | cut -d\' -f2
+}
+
mount_iso() {
LOOPDEV=$(/sbin/losetup -n -O NAME -j "${ISO_FILEPATH}")
if [[ -n "$LOOPDEV" ]]