summaryrefslogtreecommitdiffstats
path: root/lib/container/list
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-23 15:36:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-23 16:30:59 +0000
commit93d59c3176876b0990b27375458cf6518459bb07 (patch)
tree85403b3d9ac7f9df4b91195124b342dee81ec640 /lib/container/list
parentReleasing debian version 20180825-3. (diff)
downloadopen-infrastructure-compute-tools-93d59c3176876b0990b27375458cf6518459bb07.tar.xz
open-infrastructure-compute-tools-93d59c3176876b0990b27375458cf6518459bb07.zip
Merging upstream version 20190222.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/container/list')
-rwxr-xr-xlib/container/list27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/container/list b/lib/container/list
index 816d521..62f6a5b 100755
--- a/lib/container/list
+++ b/lib/container/list
@@ -1,7 +1,6 @@
#!/bin/sh
-# container-tools - Manage systemd-nspawn containers
-# Copyright (C) 2014-2018 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -20,13 +19,15 @@
set -e
+PROJECT="open-infrastructure"
+PROGRAM="container"
COMMAND="$(basename ${0})"
-CONFIG="/etc/container-tools/config"
-HOOKS="/etc/container-tools/hooks"
+CONFIG="/etc/${PROJECT}/${PROGRAM}/config"
+HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks"
MACHINES="/var/lib/machines"
-VERSION="$(container version)"
+VERSION="$(${PROGRAM} version)"
Parameters ()
{
@@ -106,7 +107,7 @@ Parameters ()
Usage ()
{
- echo "Usage: container ${COMMAND} [-a|--all] [--csv-separator SEPARATOR] [--format FORMAT] [-h|--host HOSTNAME] [--nwdiag-color COLOR] [--nwdiag-label LABEL] [-o|--other] [-s|--started] [-t|--stopped]" >&2
+ echo "Usage: ${PROGRAM} ${COMMAND} [-a|--all] [--csv-separator SEPARATOR] [--format FORMAT] [-h|--host HOSTNAME] [--nwdiag-color COLOR] [--nwdiag-label LABEL] [-o|--other] [-s|--started] [-t|--stopped]" >&2
exit 1
}
@@ -114,7 +115,7 @@ Parameters "${@}"
LIST="${LIST:-started stopped}"
FORMAT="${FORMAT:-cli}"
-HOST="${HOST:-$(hostname -f)}"
+HOST="${HOST:-$(hostname -f 2> /dev/null || hostname)}"
CSV_SEPARATOR="${CSV_SEPARATOR:-,}"
@@ -233,7 +234,7 @@ EOF
csv)
cat << EOF
-# container-tools version ${VERSION}
+# compute-tools ${VERSION}
Host${CSV_SEPARATOR}Container${CSV_SEPARATOR}Status${CSV_SEPARATOR}IPv4-Address
EOF
@@ -243,7 +244,7 @@ EOF
cat << EOF
{
- "container-tools": {
+ "compute-tools": {
"version": "${VERSION}",
},
"host": {
@@ -258,7 +259,7 @@ EOF
NETWORK="$(echo ${HOST} | sed -e 's|\.|_|g')"
cat << EOF
-# container-tools ${VERSION}
+# compute-tools ${VERSION}
nwdiag {
external_connector = none;
network ${NETWORK} {
@@ -294,7 +295,7 @@ EOF
cat << EOF
---
-container_tools:
+compute_tools:
version: ${VERSION}
host:
@@ -308,9 +309,9 @@ EOF
xml)
cat << EOF
-<container-tools>
+<compute-tools>
<version>${VERSION}</version>
-</container-tools>
+</compute-tools>
<host>
<name>${HOST}</name>
</host>