summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2016-09-18 21:41:39 +0800
committerIru Cai <mytbk920423@gmail.com>2016-09-18 21:41:39 +0800
commitfc1b28000a59a690f02bc2aa96d688242ded9534 (patch)
tree74b958956dc20624c9c0f02e6faebc8c9413e072
parentef11ea4ded0865cce7f02f16d46f036388ffb230 (diff)
downloadliveusb-builder-fc1b28000a59a690f02bc2aa96d688242ded9534.tar.xz
add getdiskbypart() function
-rw-r--r--functions.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/functions.sh b/functions.sh
index 65bf6fb..664aa24 100644
--- a/functions.sh
+++ b/functions.sh
@@ -80,6 +80,10 @@ getuuid() {
lsblk -n -o UUID "$1"
}
+getdiskbypart() {
+ lsblk -s --raw -o NAME -n "$1" | tail -n1
+}
+
as-root() {
if [ "$UID" == 0 ]; then
"$@"