From 10a4caf8a5bf6de99248b133a9cb90e791067541 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 28 Dec 2018 15:36:56 +0800 Subject: Simplify the vnconfig(8) usage --- dfly-update | 4 ++-- 1 file 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} -- cgit v1.2.2