From 4a2be6f8a3ad287b5124f28471bdaac47900c3a9 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 11 Sep 2010 11:51:37 +0000 Subject: [PATCH] extract ip from config file git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@228 191e9f34-6774-4a6d-acfc-7664dacd4a2a --- recepies/lxc/lxc-watchdog.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/recepies/lxc/lxc-watchdog.sh b/recepies/lxc/lxc-watchdog.sh index a68d33b..90c162f 100755 --- a/recepies/lxc/lxc-watchdog.sh +++ b/recepies/lxc/lxc-watchdog.sh @@ -46,6 +46,7 @@ lxc_status() { boot="-" hostname=`cat $(lxc_rootfs $name)/etc/hostname` ip=`grep address $(lxc_rootfs $name)/etc/network/interfaces | sed 's/.*address //'` + test -z "$ip" && ip=`grep lxc.network.ipv4 /var/lib/lxc/narada/config | cut -d= -f2` test -s /var/lib/lxc/$name/on_boot && boot="boot" echo "$name $status $boot $(lxc_rootfs $name) $ip $hostname" done ) | column -t -- 2.20.1