From b7ee6e3d6fe43109561cb2b8a90fb816ffc726f0 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Fri, 9 Sep 2011 18:21:14 +0000 Subject: [PATCH] use new lxc-info 0.7.5 output for status git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@271 191e9f34-6774-4a6d-acfc-7664dacd4a2a --- recepies/lxc/lxc-watchdog.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recepies/lxc/lxc-watchdog.sh b/recepies/lxc/lxc-watchdog.sh index 1ae6fad..ed70fa4 100755 --- a/recepies/lxc/lxc-watchdog.sh +++ b/recepies/lxc/lxc-watchdog.sh @@ -54,7 +54,8 @@ lxc_ip() { } lxc_status() { - ( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | xargs -i lxc-info -n {} | sed "s/'//g" | while read name is status ; do + ( find /var/lib/lxc/ -name "config" | cut -d/ -f5 | sort -u | while read name ; do + status=`lxc-info -n $name 2>/dev/null | grep state: | cut -d: -f2` boot="-" test -s /var/lib/lxc/$name/on_boot && boot="boot" echo "$name $status $boot $(lxc_rootfs $name) $(lxc_ip $name) $(lxc_hostname $name)" -- 2.20.1