summaryrefslogtreecommitdiffstats
path: root/lib/container/move
diff options
context:
space:
mode:
authorSimon Spöhel <simon.spoehel@open-infrastructure.net>2017-07-09 13:52:29 +0000
committerSimon Spöhel <simon.spoehel@open-infrastructure.net>2017-07-09 15:14:27 +0000
commitb71a3b319fa347157973e45e4e08f407e2cb5d7e (patch)
tree234c9d9fdba16e7b997d4e73fc030f37510bde2e /lib/container/move
parentUpdating output of container-shell help. (diff)
downloadcompute-tools-b71a3b319fa347157973e45e4e08f407e2cb5d7e.tar.xz
compute-tools-b71a3b319fa347157973e45e4e08f407e2cb5d7e.zip
Making container-tools use nspawn files.
Diffstat (limited to 'lib/container/move')
-rwxr-xr-xlib/container/move10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/container/move b/lib/container/move
index 3cc2e40..b2f2b42 100755
--- a/lib/container/move
+++ b/lib/container/move
@@ -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"
@@ -138,11 +138,11 @@ do
done
# Run
-mv "${CONFIG}/${OLD}.conf" "${CONFIG}/${NEW}.conf"
+mv "${CONFIG}/${OLD}.nspawn" "${CONFIG}/${NEW}.nspawn"
mv "${MACHINES}/${OLD}" "${MACHINES}/${NEW}"
# rw bind mounts
-BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+BIND="$(crudini --get ${CONFIG}/${NAME}.nspawn Files Bind)"
if [ -n "${BIND}" ]
then
@@ -169,7 +169,7 @@ then
fi
# 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
@@ -196,7 +196,7 @@ then
fi
# config
-sed -i -e "s|${OLD}|${NEW}|g" "${CONFIG}/${NEW}.conf"
+sed -i -e "s|${OLD}|${NEW}|g" "${CONFIG}/${NEW}.nspawn"
# Post hooks
for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"