From d6538a951ed228849748e8eb3a0b4f2852d6f082 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 5 May 2022 18:08:00 +0200 Subject: Showing all IP address for stopped containers in container list command. Signed-off-by: Daniel Baumann --- libexec/container/list | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libexec/container') 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}" -- cgit v1.2.3