summaryrefslogtreecommitdiffstats
path: root/lib/container/stop
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-03 10:24:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-03 10:24:24 +0000
commitd013d5bcb55b4b0cd2f6b3cd1b7ea480f1c2f5a1 (patch)
tree575559903db372b4a37576838ce131a5c8dc118c /lib/container/stop
parentAdding upstream version 20170101. (diff)
downloadopen-infrastructure-compute-tools-d013d5bcb55b4b0cd2f6b3cd1b7ea480f1c2f5a1.tar.xz
open-infrastructure-compute-tools-d013d5bcb55b4b0cd2f6b3cd1b7ea480f1c2f5a1.zip
Adding upstream version 20170401.upstream/20170401
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 b8793ac..359a136 100755
--- a/lib/container/stop
+++ b/lib/container/stop
@@ -127,7 +127,7 @@ case "${CLEAN}" in
done
fi
- # Removing bind mounts
+ # Removing rw bind mounts
BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
if [ -n "${BIND}" ]
@@ -142,6 +142,21 @@ case "${CLEAN}" in
done
fi
+ # Removing ro bind mounts
+ BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+
+ if [ -n "${BIND_RO}" ]
+ then
+ BINDS_RO="$(echo ${BIND_RO} | sed -e 's|;| |g')"
+
+ for BIND_RO in ${BINDS_RO}
+ do
+ DIRECTORY="$(echo ${BIND_RO} | 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)"