--- recepies/lxc/lxc-watchdog.sh 2010/10/24 11:55:02 232 +++ recepies/lxc/lxc-watchdog.sh 2010/10/24 12:23:20 233 @@ -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() { @@ -71,6 +72,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 }