summaryrefslogtreecommitdiffstats
path: root/lib/container
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-06-18 06:31:19 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2016-07-01 09:31:09 +0000
commit221da55a6498874224c44309ab7636fe04de13b7 (patch)
tree6e262cc54b2865eb533e7942fb6ad0a0bcb2fce7 /lib/container
parentCorrecting bind mount directory creation in container create command to work ... (diff)
downloadcompute-tools-221da55a6498874224c44309ab7636fe04de13b7.tar.xz
compute-tools-221da55a6498874224c44309ab7636fe04de13b7.zip
Correcting bind mount directory removal in container remove command to work with multiple directories at once.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib/container')
-rwxr-xr-xlib/container/remove14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/container/remove b/lib/container/remove
index f43bf1c..e4bb20c 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -116,13 +116,19 @@ esac
# data
if [ -e "${CONFIG}/${NAME}.conf" ]
then
+ # Removing bind mounts
BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
- DIRECTORY="$(echo ${BIND} | awk -F: '{ print $1 }')"
-
- if [ -e "${DIRECTORY}" ]
+ if [ -n "${BIND}" ]
then
- rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} || true
+ BINDS="$(echo ${BIND} | sed -e 's|;| |g')"
+
+ for BIND in ${BINDS}
+ do
+ DIRECTORY="$(echo ${BIND} | awk -F: '{ print $1 }')"
+
+ rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} > /dev/null 2>&1 || true
+ done
fi
fi