~ubuntu-branches/ubuntu/quantal/lxc/quantal-201208232243

3.1.11 by Daniel Baumann
* Taking over lxc together with Jonas, Guido is MIA.
1
#!/bin/sh
2
3
set -e
4
5
if [ ! -x "$(which lxc-info 2>/dev/null)" ]
6
then
3.1.31 by Daniel Baumann
* Adding updated French debconf templates from Christian Perrier
7
	echo "E: lxc-info - no such file" >&2
3.1.11 by Daniel Baumann
* Taking over lxc together with Jonas, Guido is MIA.
8
	exit 1
9
fi
10
3.1.36 by Daniel Baumann
* Also listing frozen containers in lxc-list.
11
for _STATUS in RUNNING FROZEN STOPPED
3.1.11 by Daniel Baumann
* Taking over lxc together with Jonas, Guido is MIA.
12
do
13
	echo ${_STATUS}
14
111 by Stéphane Graber
Fix lxc-list to work on both Debian and Ubuntu and list containers only once.
15
	for _CONTAINER in $(lxc-ls | sort -u)
3.1.11 by Daniel Baumann
* Taking over lxc together with Jonas, Guido is MIA.
16
	do
3.1.16 by Daniel Baumann
* Do not bail out with usage message when invoking lxc-list via lxc
17
		if lxc-info -n ${_CONTAINER} 2>&1 | grep -qs "${_STATUS}"
18
		then
19
			echo -n "  ${_CONTAINER}"
20
111 by Stéphane Graber
Fix lxc-list to work on both Debian and Ubuntu and list containers only once.
21
			if [ -e /etc/lxc/auto/${_CONTAINER} ] || [ -e /etc/lxc/auto/${_CONTAINER}.conf ]
3.1.16 by Daniel Baumann
* Do not bail out with usage message when invoking lxc-list via lxc
22
			then
23
				echo " (auto)"
24
			else
25
				echo
26
			fi
27
		fi
3.1.11 by Daniel Baumann
* Taking over lxc together with Jonas, Guido is MIA.
28
	done
29
30
	echo
31
done