summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
Diffstat (limited to 'lib/container/list')
-rwxr-xr-xlib/container/list37
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/container/list b/lib/container/list
index d522623..9b93173 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -86,7 +86,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} -a|--all --format FORMAT -s|--started -t|--stopped" >&2
+ echo "Usage: container ${COMMAND} [-a|--all] [--format FORMAT] [-h|--host HOSTNAME] [-o|--other] [-s|--started] [-t|--stopped]" >&2
exit 1
}
@@ -125,21 +125,7 @@ Show ()
;;
full)
- FIRST_LINE="true"
-
- for ADDRESS in ${ADDRESSES}
- do
- case "${FIRST_LINE}" in
- true)
- FIRST_LINE="false"
- printf "%-80s %-29s\n" "${STATUS} ${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}"
- ;;
-
- *)
- printf "%-80s %-29s\n" "" "${ADDRESS}"
- ;;
- esac
- done
+ printf "%-80s %-29s\n" "${STATUS} ${BLUE}${CONTAINER}${NORMAL}" "${YELLOW}${ADDRESS}${NORMAL}"
;;
esac
}
@@ -183,12 +169,14 @@ do
;;
esac
+ ADDRESS=""
+
if [ -e "${MACHINES}/${CONTAINER}/etc/network/interfaces" ]
then
- ADDRESSES="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces)"
+ ADDRESS="$(awk '/address/ { print $2 }' ${MACHINES}/${CONTAINER}/etc/network/interfaces | head -n1)"
fi
- ADDRESSES="${ADDRESSES:-n/a}"
+ ADDRESS="${ADDRESS:-n/a}"
if echo ${LIST} | grep -qs all
then
@@ -207,3 +195,16 @@ do
fi
done
done
+
+case "${FORMAT}" in
+ full)
+
+cat << EOF
+--------------------------------------------------------------------------------
+EOF
+
+ ;;
+
+ short)
+ ;;
+esac