From 21cbee9fa17202172af7ef129397b9cb8d40b41c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 21 Jul 2022 19:45:42 +0200 Subject: Correcting container info command to report IP addresses of stopped container. Signed-off-by: Daniel Baumann --- libexec/container/info | 8 ++++---- 1 file 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}" -- cgit v1.2.3