summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-05-18 18:28:46 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-05-18 18:29:07 +0000
commitb90ddebe1d1cb49c30c3a9d99119e3b0d14995fd (patch)
treea462154b0ea87956dca914338f88544f205ba06a /lib/container/list
parentReleasing debian version 20160501-1. (diff)
downloadopen-infrastructure-compute-tools-b90ddebe1d1cb49c30c3a9d99119e3b0d14995fd.tar.xz
open-infrastructure-compute-tools-b90ddebe1d1cb49c30c3a9d99119e3b0d14995fd.zip
Merging upstream version 20160515.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container/list')
-rwxr-xr-xlib/container/list54
1 files changed, 48 insertions, 6 deletions
diff --git a/lib/container/list b/lib/container/list
index 5ab5755..8b55e09 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -94,7 +94,7 @@ case "${FORMAT}" in
NORMAL="$(tput sgr0)"
cat << EOF
-Container IPv4 Address Status
+Container IPv4 Address(es) Status
--------------------------------------------------------------------------------
EOF
@@ -118,9 +118,9 @@ do
if [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
then
- ADDRESS="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
+ ADDRESSES="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
else
- ADDRESS="n/a"
+ ADDRESSES="n/a"
fi
case "${STATE}" in
@@ -142,7 +142,21 @@ do
;;
full)
- printf "%-72s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" "${STATUS}"
+ FIRST_LINE="true"
+
+ for ADDRESS in ${ADDRESSES}
+ do
+ case "${FIRST_LINE}" in
+ true)
+ FIRST_LINE="false"
+ printf "%-69s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" " ${STATUS}"
+ ;;
+
+ *)
+ printf "%-54s %-29s\n" "" "${ADDRESS}"
+ ;;
+ esac
+ done
;;
esac
;;
@@ -156,7 +170,21 @@ do
;;
full)
- printf "%-72s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" "${STATUS}"
+ FIRST_LINE="true"
+
+ for ADDRESS in ${ADDRESSES}
+ do
+ case "${FIRST_LINE}" in
+ true)
+ FIRST_LINE="false"
+ printf "%-69s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" " ${STATUS}"
+ ;;
+
+ *)
+ printf "%-54s %-29s\n" "" "${ADDRESS}"
+ ;;
+ esac
+ done
;;
esac
;;
@@ -175,7 +203,21 @@ do
;;
full)
- printf "%-72s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" "${STATUS}"
+ FIRST_LINE="true"
+
+ for ADDRESS in ${ADDRESSES}
+ do
+ case "${FIRST_LINE}" in
+ true)
+ FIRST_LINE="false"
+ printf "%-69s %-29s %-7s\n" "${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}" " ${STATUS}"
+ ;;
+
+ *)
+ printf "%-54s %-29s\n" "" "${ADDRESS}"
+ ;;
+ esac
+ done
;;
esac
;;