5 |
dir=$1 |
dir=$1 |
6 |
hostname=ve2lxc |
hostname=ve2lxc |
7 |
ip=$2 |
ip=$2 |
8 |
netmask=255.255.254.0 |
netmask=`grep netmask /etc/network/interfaces | head -1 | sed 's/^.*netmask *//'` |
9 |
|
gateway=`grep gateway /etc/network/interfaces | head -1 | sed 's/^.*gateway *//'` |
10 |
|
|
11 |
test -z "$ip" && ip=10.60.0.253 |
test -z "$ip" && ip=10.60.0.253 |
12 |
|
|
46 |
iface eth0 inet static |
iface eth0 inet static |
47 |
address $ip |
address $ip |
48 |
netmask $netmask |
netmask $netmask |
49 |
|
gateway $gateway |
50 |
|
|
51 |
__interfaces__ |
__interfaces__ |
52 |
|
|
83 |
lxc.cgroup.devices.allow = c 254:0 rwm |
lxc.cgroup.devices.allow = c 254:0 rwm |
84 |
__lxc__ |
__lxc__ |
85 |
|
|
86 |
|
cp -v /etc/resolv.conf /$dir/etc/resolv.conf |
87 |
|
|
88 |
mount | grep /cgroup || mount /cgroup || exit |
mount | grep /cgroup || mount /cgroup || exit |
89 |
|
|
90 |
lxc-create -n ve2lxc -f $conf && lxc-start -n ve2lxc |
lxc-create -n ve2lxc -f $conf && lxc-start -n ve2lxc |