summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-10-06 15:05:42 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2018-05-27 05:59:31 +0000
commit1e03e6dc46624f658239c3179875bd28b67fa91a (patch)
tree38731aa38565f40cb5419ea8e17af1af84f1f186 /lib/container/remove
parentReleasing version 20180503. (diff)
downloadcompute-tools-1e03e6dc46624f658239c3179875bd28b67fa91a.tar.xz
compute-tools-1e03e6dc46624f658239c3179875bd28b67fa91a.zip
Switching to systemd-nspawn configuration files from /etc/container-tools/config.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib/container/remove')
-rwxr-xr-xlib/container/remove12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/container/remove b/lib/container/remove
index e8dd653..8ce87bb 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -22,7 +22,7 @@ set -e
COMMAND="$(basename ${0})"
-CONFIG="/etc/container-tools/config"
+CONFIG="/etc/systemd/nspawn"
HOOKS="/etc/container-tools/hooks"
MACHINES="/var/lib/machines"
@@ -111,7 +111,7 @@ then
Usage
fi
-if [ ! -e "${MACHINES}/${NAME}" ] && [ ! -e "${CONFIG}/${NAME}.conf" ]
+if [ ! -e "${MACHINES}/${NAME}" ] && [ ! -e "${CONFIG}/${NAME}.nspawn" ]
then
echo "'${NAME}': no such container" >&2
exit 1
@@ -176,10 +176,10 @@ do
done
# data
-if [ -e "${CONFIG}/${NAME}.conf" ]
+if [ -e "${CONFIG}/${NAME}.nspawn" ]
then
# Removing rw bind mounts
- BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BIND}" ]
then
@@ -194,7 +194,7 @@ then
fi
# Removing ro bind mounts
- BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.nspawn)"
if [ -n "${BIND_RO}" ]
then
@@ -211,7 +211,7 @@ fi
# Run
rm --preserve-root --one-file-system -rf ${RM_OPTIONS} "${MACHINES}/${NAME}"
-rm -f ${RM_OPTIONS} "${CONFIG}/${NAME}.conf"
+rm -f ${RM_OPTIONS} "${CONFIG}/${NAME}.nspawn"
# Post hooks
for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"