summaryrefslogtreecommitdiffstats
path: root/lib/container/remove
diff options
context:
space:
mode:
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 c9a45a6..24a58be 100755
--- a/lib/container/remove
+++ b/lib/container/remove
@@ -20,7 +20,7 @@ set -e
COMMAND="$(basename ${0})"
-CONFIG="/etc/container-tools/config"
+CONFIG="/etc/systemd/nspawn"
HOOKS="/etc/container-tools/hooks"
MACHINES="/var/lib/machines"
@@ -104,7 +104,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
@@ -160,10 +160,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="$(crudini --get ${CONFIG}/${NAME}.nspawn Files Bind)"
if [ -n "${BIND}" ]
then
@@ -178,7 +178,7 @@ then
fi
# Removing ro bind mounts
- BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+ BIND_RO="$(crudini --get ${CONFIG}/${NAME}.nspawn Files BindReadOnly)"
if [ -n "${BIND_RO}" ]
then
@@ -195,7 +195,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}"