summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
Diffstat (limited to '')
-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}"