--- recepies/lxc/lxc-watchdog.sh 2010/10/24 11:55:02 232 +++ recepies/lxc/lxc-watchdog.sh 2011/01/22 16:07:46 234 @@ -47,8 +47,9 @@ } lxc_ip() { - grep lxc.network.ipv4 /var/lib/lxc/$name/config | cut -d= -f2 || - grep address $(lxc_rootfs $name)/etc/network/interfaces | sed 's/.*address //' + ( grep lxc.network.ipv4 /var/lib/lxc/$name/config | cut -d= -f2 || \ + grep address $(lxc_rootfs $name)/etc/network/interfaces | sed 's/.*address //' ) | \ + sed -e 's/ *//g' -e 's/\/.*$//' } lxc_status() { @@ -64,6 +65,7 @@ rootfs=$(lxc_rootfs $1) ls \ + $rootfs/etc/rc?.d/*checkroot* \ $rootfs/etc/rc?.d/*umountfs \ $rootfs/etc/rc?.d/*umountroot \ $rootfs/etc/rc?.d/*hwclock* \ @@ -71,6 +73,7 @@ 2>/dev/null | xargs -i rm -v {} echo $1 > $rootfs/etc/hostname + grep $1 $rootfs/etc/hosts || echo "$(lxc_ip $1) $1" >> $rootfs/etc/hosts }