diff options
author | Simon Spöhel <simon.spoehel@open-infrastructure.net> | 2017-07-09 13:52:29 +0000 |
---|---|---|
committer | Simon Spöhel <simon.spoehel@open-infrastructure.net> | 2017-07-09 15:14:27 +0000 |
commit | b71a3b319fa347157973e45e4e08f407e2cb5d7e (patch) | |
tree | 234c9d9fdba16e7b997d4e73fc030f37510bde2e /lib/container/remove | |
parent | Updating output of container-shell help. (diff) | |
download | compute-tools-b71a3b319fa347157973e45e4e08f407e2cb5d7e.tar.xz compute-tools-b71a3b319fa347157973e45e4e08f407e2cb5d7e.zip |
Making container-tools use nspawn files.
Diffstat (limited to '')
-rwxr-xr-x | lib/container/remove | 12 |
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}" |