summaryrefslogtreecommitdiffstats
path: root/libexec/container
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-20 09:54:01 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2022-07-20 12:44:09 +0000
commit092f3ec2476baff70ba6eae1181a8853924ace9d (patch)
treeb114401f147268854c2c37d3b604c51e9f6bb35d /libexec/container
parentReleasing version 20220704. (diff)
downloadcompute-tools-092f3ec2476baff70ba6eae1181a8853924ace9d.tar.xz
compute-tools-092f3ec2476baff70ba6eae1181a8853924ace9d.zip
Returning all ip addresses in cnt info command.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xlibexec/container/info6
1 files changed, 3 insertions, 3 deletions
diff --git a/libexec/container/info b/libexec/container/info
index 699a253..9c77214 100755
--- a/libexec/container/info
+++ b/libexec/container/info
@@ -174,16 +174,16 @@ esac
case "${STATUS}" in
started)
- IP="$(cnt run -n ${NAME} -- hostname -I | awk '{ print $1 }')"
+ IP="$(cnt run -n ${NAME} -- hostname -I)"
;;
*)
if ls "${MACHINES}/${CONTAINER}/etc/systemd/network"/*.network > /dev/null 2>&1
then
- IP="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network | head -n1)"
+ IP="$(awk -FAddress= '/^Address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/systemd/network/*.network)"
elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
then
- IP="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces | head -n1)"
+ IP="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
fi
IP="${IP:-n/a}"