--- recepies/lxc/ve2lxc.sh 2009/05/17 20:54:48 86 +++ recepies/lxc/ve2lxc.sh 2009/05/21 15:46:59 92 @@ -1,8 +1,12 @@ #!/bin/sh -x -test -z "$1" && echo "usage: $0 /path/to/ve/private" && exit +test -z "$1" && echo "usage: $0 /path/to/ve/private [10.60.0.253]" && exit dir=$1 +ip=$2 +netmask=255.255.254.0 + +test -z "$ip" && ip=10.60.0.253 path=/$dir/etc/inittab tmp=/tmp/inittab @@ -38,6 +42,17 @@ echo "cgroup /cgroup cgroup rw 0 0" >> /etc/fstab fi +grep eth0 $dir/etc/network/interfaces || cat << __interfaces__ > $dir/etc/network/interfaces +auto eth0 lo + +iface lo inet loopback + +iface eth0 inet static + address $ip + netmask $netmask + +__interfaces__ + mount | grep /cgroup || mount /cgroup || exit -lxc-create -n ve2lxc -f $conf && read && lxc-start -n ve2lxc +lxc-create -n ve2lxc -f $conf && lxc-start -n ve2lxc