diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-07-21 17:46:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-07-21 17:46:31 +0000 |
commit | dbb859d67a4901390ef60a1e01b25f69b26fd081 (patch) | |
tree | f36049a63e977428c8128289d7b55dc865763208 /libexec/container | |
parent | Correcting container info command to report IP addresses of stopped container. (diff) | |
download | compute-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/container')
-rwxr-xr-x | libexec/container/info | 4 |
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}" |