summaryrefslogtreecommitdiffstats
path: root/libexec/container/list
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-05-05 16:08:00 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-05-05 16:27:34 +0000
commitd6538a951ed228849748e8eb3a0b4f2852d6f082 (patch)
treec6268eb91d1ac341b0c477a4ebb60718536cd3a8 /libexec/container/list
parentUpdating copyright notices for 2022. (diff)
downloadcompute-tools-d6538a951ed228849748e8eb3a0b4f2852d6f082.tar.xz
compute-tools-d6538a951ed228849748e8eb3a0b4f2852d6f082.zip
Showing all IP address for stopped containers in container list command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/list4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/container/list b/libexec/container/list
index 614e0d8..a56c1f8 100755
--- a/libexec/container/list
+++ b/libexec/container/list
@@ -387,10 +387,10 @@ do
*)
if ls "${MACHINES}/${CONTAINER}/etc/systemd/network"/*.network > /dev/null 2>&1
then
- ADDRESS="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network | head -n1)"
+ ADDRESS="$(for IP in $(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network); do echo -n "${IP} "; done)"
elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
then
- ADDRESS="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces | head -n1)"
+ ADDRESS="$(for IP in $(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces); do echo -n "${IP} "; done)"
fi
ADDRESS="${ADDRESS:-n/a}"