summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-21 17:45:42 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-21 17:45:42 +0000
commit21cbee9fa17202172af7ef129397b9cb8d40b41c (patch)
treec60ce9286b5cfab8ead9e08de08730952db78b45 /lib
parentReturning all ip addresses in cnt info command. (diff)
downloadcompute-tools-21cbee9fa17202172af7ef129397b9cb8d40b41c.tar.xz
compute-tools-21cbee9fa17202172af7ef129397b9cb8d40b41c.zip
Correcting container info command to report IP addresses of stopped container.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/info8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/container/info b/libexec/container/info
index 9c77214..d65258a 100755
--- a/libexec/container/info
+++ b/libexec/container/info
@@ -178,12 +178,12 @@ case "${STATUS}" in
;;
*)
- if ls "${MACHINES}/${CONTAINER}/etc/systemd/network"/*.network > /dev/null 2>&1
+ if ls "${MACHINES}/${NAME}/etc/systemd/network"/*.network > /dev/null 2>&1
then
- IP="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network)"
- elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
+ IP="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${NAME}/etc/systemd/network/*.network)"
+ elif [ -e "${MACHINES}/${NAME}/etc/network/interfaces" ]
then
- IP="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
+ IP="$(awk '/address/ { print $2 }' ${MACHINES}/${NAME}/etc/network/interfaces)"
fi
IP="${IP:-n/a}"