summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-21 17:46:31 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-21 17:46:31 +0000
commitdbb859d67a4901390ef60a1e01b25f69b26fd081 (patch)
treef36049a63e977428c8128289d7b55dc865763208 /libexec
parentCorrecting container info command to report IP addresses of stopped container. (diff)
downloadcompute-tools-dbb859d67a4901390ef60a1e01b25f69b26fd081.tar.xz
compute-tools-dbb859d67a4901390ef60a1e01b25f69b26fd081.zip
Handling multiple IP addresses in container info command the same way for stopped containers as for started ones.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/container/info4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/container/info b/libexec/container/info
index d65258a..68666bb 100755
--- a/libexec/container/info
+++ b/libexec/container/info
@@ -180,10 +180,10 @@ case "${STATUS}" in
*)
if ls "${MACHINES}/${NAME}/etc/systemd/network"/*.network > /dev/null 2>&1
then
- IP="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${NAME}/etc/systemd/network/*.network)"
+ IP="$(awk -FAddress= '/^Address/ { printf "%s ", $2 }' ${MACHINES}/${NAME}/etc/systemd/network/*.network)"
elif [ -e "${MACHINES}/${NAME}/etc/network/interfaces" ]
then
- IP="$(awk '/address/ { print $2 }' ${MACHINES}/${NAME}/etc/network/interfaces)"
+ IP="$(awk '/address/ { printf "%s ", $2 }' ${MACHINES}/${NAME}/etc/network/interfaces)"
fi
IP="${IP:-n/a}"