aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-12-28 15:36:56 +0800
committerAaron LI <aly@aaronly.me>2018-12-28 15:36:56 +0800
commit10a4caf8a5bf6de99248b133a9cb90e791067541 (patch)
tree8ed05971d6d27a7417937f6e8f8dad9f9c990b6d
parent19e46554ed3ccafc0c4324279e9354fe0d4f464a (diff)
downloaddfly-update-10a4caf8a5bf6de99248b133a9cb90e791067541.tar.bz2
Simplify the vnconfig(8) usage
-rwxr-xr-xdfly-update4
1 files changed, 2 insertions, 2 deletions
diff --git a/dfly-update b/dfly-update
index 07fa1c2..68d74c6 100755
--- a/dfly-update
+++ b/dfly-update
@@ -335,10 +335,10 @@ mount_image() {
local imgfile="$1"
local mntpnt="$2"
- local vn=$(vnconfig -l | fgrep "not in use" | head -n 1 | cut -d':' -f 1)
+ local vn
[ -d "${mntpnt}" ] || mkdir "${mntpnt}"
echo "Mounting image ${imgfile} to ${mntpnt} ..."
- vnconfig -v -c ${vn} ${imgfile} || exit ${EC_VN}
+ vn=$(vnconfig -v -c vn ${imgfile}) || exit ${EC_VN}
mount -r /dev/${vn}s2a ${mntpnt} &&
echo "DONE" ||
exit ${EC_MOUNT}