From 366b9ac41c3c5ee8ceca2a024554fe6a81b2a46d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 Jun 2016 08:30:10 +0200 Subject: Correcting bind mount directory creation in container create command to work with multiple directories at once. Signed-off-by: Daniel Baumann --- lib/container/create | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'lib/container/create') diff --git a/lib/container/create b/lib/container/create index 6d6fc86..f5d005c 100755 --- a/lib/container/create +++ b/lib/container/create @@ -135,17 +135,18 @@ fi CNT_AUTO="${CNT_AUTO:-$(hostname -f)}" -BINDS="$(echo ${BIND} | sed -e 's|;| |g')" +# Creating bind mounts +if [ -n "${BIND}" ] +then + BINDS="$(echo ${BIND} | sed -e 's|;| |g')" -for ENTRY in ${BINDS} -do - DIRECTORY="$(echo ${ENTRY} | awk -F: '{ print $1 }')" + for BIND in ${BINDS} + do + DIRECTORY="$(echo ${BIND} | awk -F: '{ print $1 }')" - if [ ! -e "${DIRECTORY}" ] - then mkdir -p "${DIRECTORY}" - fi -done + done +fi # config mkdir -p "${CONFIG}" -- cgit v1.2.3