summaryrefslogtreecommitdiffstats
path: root/lib/container/stop
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-06-01 13:56:41 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-06-01 13:57:06 +0000
commitce88f18bae951a614940e0e4497e9f20aa4011b6 (patch)
tree0953e87b0272059527176120782a8e0e463ccc87 /lib/container/stop
parentReleasing debian version 20160515-1. (diff)
downloadopen-infrastructure-compute-tools-ce88f18bae951a614940e0e4497e9f20aa4011b6.tar.xz
open-infrastructure-compute-tools-ce88f18bae951a614940e0e4497e9f20aa4011b6.zip
Merging upstream version 20160601.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/stop')
-rwxr-xr-xlib/container/stop17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/container/stop b/lib/container/stop
index 67cc403..fb470f6 100755
--- a/lib/container/stop
+++ b/lib/container/stop
@@ -92,9 +92,24 @@ fi
STATE="$(machinectl show ${NAME} 2>&1 | awk -F= '/^State=/ { print $2 }')"
-# Removing network configuration
case "${CLEAN}" in
true)
+ # Removing bind mounts
+ BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+
+ if [ -n "${BIND}" ]
+ then
+ 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
+
+ # Removing network configuration
NETWORK_VETH_EXTRA_CONF="$(awk -F= '/^network-veth-extra=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
case "${NETWORK_VETH_EXTRA_CONF}" in