#!/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
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