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 |
|
|
53 |
echo $hostname > $dir/etc/hostname |
echo $hostname > $dir/etc/hostname |
54 |
|
|
55 |
|
echo "$ip $hostname" >> $dir/etc/hosts |
56 |
|
|
57 |
conf=/tmp/ve2lxc.conf |
conf=/tmp/ve2lxc.conf |
58 |
|
|
59 |
cat << __lxc__ > $conf |
cat << __lxc__ > $conf |