summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-21 18:00:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-21 18:00:28 +0000
commitcf80d78328fae684261ca19506455b281b9dc619 (patch)
treed7d4fb493640991631d741979440a7afe10578de /libexec
parentAdding upstream version 20220704. (diff)
downloadopen-infrastructure-compute-tools-cf80d78328fae684261ca19506455b281b9dc619.tar.xz
open-infrastructure-compute-tools-cf80d78328fae684261ca19506455b281b9dc619.zip
Adding upstream version 20220721.upstream/20220721
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/container/info14
1 files changed, 9 insertions, 5 deletions
diff --git a/libexec/container/info b/libexec/container/info
index 699a253..0888cc8 100755
--- a/libexec/container/info
+++ b/libexec/container/info
@@ -167,6 +167,10 @@ case "${VERSION_BASH}" in
OS="Debian 11 (bullseye)"
;;
+ 5.2*)
+ OS="Debian 12 (bookworm)"
+ ;;
+
*)
OS="n/a"
;;
@@ -174,16 +178,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
+ 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 | head -n1)"
- elif [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
+ IP="$(awk -FAddress= '/^Address/ { printf "%s ", $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 | head -n1)"
+ IP="$(awk '/address/ { printf "%s ", $2 }' ${MACHINES}/${NAME}/etc/network/interfaces)"
fi
IP="${IP:-n/a}"