summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-03 10:25:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-04-03 10:25:05 +0000
commit98ba42a446675abeb7fb0780ef9862ccb9ba63ba (patch)
treebee576deafa49f6cad95989ac33d7feebb75d428 /lib/container/remove
parentReleasing debian version 20170101-1. (diff)
downloadopen-infrastructure-compute-tools-98ba42a446675abeb7fb0780ef9862ccb9ba63ba.tar.xz
open-infrastructure-compute-tools-98ba42a446675abeb7fb0780ef9862ccb9ba63ba.zip
Merging upstream version 20170401.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container/remove')
-rwxr-xr-xlib/container/remove17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/container/remove b/lib/container/remove
index 03549a4..1b1ba7d 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -141,7 +141,7 @@ done
# data
if [ -e "${CONFIG}/${NAME}.conf" ]
then
- # Removing bind mounts
+ # Removing rw bind mounts
BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
if [ -n "${BIND}" ]
@@ -155,6 +155,21 @@ then
rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} > /dev/null 2>&1 || true
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
fi
# Run