summaryrefslogtreecommitdiffstats
path: root/lib/container/move
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2020-09-22 20:37:37 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2020-09-22 20:37:37 +0000
commit6028765b0e1f1b34924013e758cac46b258bcf4b (patch)
tree08e7f6a213a45a6647ce0494581de04cee404b4b /lib/container/move
parentReleasing version 20200830. (diff)
downloadcompute-tools-6028765b0e1f1b34924013e758cac46b258bcf4b.tar.xz
compute-tools-6028765b0e1f1b34924013e758cac46b258bcf4b.zip
Correcting wrong usages of new and old container names in container move command, thanks to Katharina Drexel <katharina.drexel@bfh.ch> for discovering it.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'lib/container/move')
-rwxr-xr-xlib/container/move8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/container/move b/lib/container/move
index 377bd7c..a31749e 100755
--- a/lib/container/move
+++ b/lib/container/move
@@ -132,7 +132,7 @@ case "${FORCE}" in
esac
# Pre hooks
-for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${NAME}.pre-${COMMAND}"
+for FILE in "${HOOKS}/pre-${COMMAND}".* "${HOOKS}/${OLD}.pre-${COMMAND}"
do
if [ -x "${FILE}" ]
then
@@ -145,7 +145,7 @@ mv "${CONFIG}/${OLD}.conf" "${CONFIG}/${NEW}.conf"
mv "${MACHINES}/${OLD}" "${MACHINES}/${NEW}"
# rw bind mounts
-BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+BIND="$(awk -F= '/^bind=/ { print $2 }' ${CONFIG}/${NEW}.conf)"
if [ -n "${BIND}" ]
then
@@ -172,7 +172,7 @@ then
fi
# ro bind mounts
-BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NAME}.conf)"
+BIND_RO="$(awk -F= '/^bind-ro=/ { print $2 }' ${CONFIG}/${NEW}.conf)"
if [ -n "${BIND_RO}" ]
then
@@ -202,7 +202,7 @@ fi
sed -i -e "s|${OLD}|${NEW}|g" "${CONFIG}/${NEW}.conf"
# Post hooks
-for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NAME}.post-${COMMAND}"
+for FILE in "${HOOKS}/post-${COMMAND}".* "${HOOKS}/${NEW}.post-${COMMAND}"
do
if [ -x "${FILE}" ]
then