From 3184448efe5c7ce4c8be20161d85f551a136168c Mon Sep 17 00:00:00 2001 From: Iru Cai Date: Wed, 1 Jul 2020 22:51:45 +0800 Subject: add get_iso_label function which is useful for some iso files --- functions.sh | 6 ++++++ 1 file changed, 6 insertions(+) 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" ]] -- cgit v1.2.3