diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-12-11 13:21:27 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-12-11 13:31:09 +0000 |
commit | ef124f86b4c1af391c70007f2a2658a24e265271 (patch) | |
tree | 92eec333ae554f76402c3a5155116c9d1fcfb95d /lib/container | |
parent | Releasing debian version 20161101-lts1-1. (diff) | |
download | open-infrastructure-compute-tools-ef124f86b4c1af391c70007f2a2658a24e265271.tar.xz open-infrastructure-compute-tools-ef124f86b4c1af391c70007f2a2658a24e265271.zip |
Merging upstream version 20161101-lts2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lib/container')
-rwxr-xr-x | lib/container/list | 37 | ||||
-rwxr-xr-x | lib/container/remove | 2 |
2 files changed, 20 insertions, 19 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 diff --git a/lib/container/remove b/lib/container/remove index 843e9c3..04e7d30 100755 --- a/lib/container/remove +++ b/lib/container/remove @@ -82,7 +82,7 @@ then Usage fi -if [ ! -e "${MACHINES}/${NAME}" ] +if [ ! -e "${MACHINES}/${NAME}" ] && [ ! -e "${CONFIG}/${NAME}.conf" ] then echo "'${NAME}': no such container" >&2 exit 1 |