diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-07-21 17:45:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-07-21 17:45:42 +0000 |
commit | 21cbee9fa17202172af7ef129397b9cb8d40b41c (patch) | |
tree | c60ce9286b5cfab8ead9e08de08730952db78b45 | |
parent | Returning all ip addresses in cnt info command. (diff) | |
download | compute-tools-21cbee9fa17202172af7ef129397b9cb8d40b41c.tar.xz compute-tools-21cbee9fa17202172af7ef129397b9cb8d40b41c.zip |
Correcting container info command to report IP addresses of stopped container.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
-rwxr-xr-x | libexec/container/info | 8 |
1 files 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}" |