From b71a3b319fa347157973e45e4e08f407e2cb5d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sp=C3=B6hel?= Date: Sun, 9 Jul 2017 15:52:29 +0200 Subject: Making container-tools use nspawn files. --- lib/container/remove | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/container/remove') 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}" -- cgit v1.2.3