/[sysadmin-cookbook]/recepies/lxc/ve2lxc.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/lxc/ve2lxc.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 86 by dpavlin, Sun May 17 20:54:48 2009 UTC revision 92 by dpavlin, Thu May 21 15:46:59 2009 UTC
# Line 1  Line 1 
1  #!/bin/sh -x  #!/bin/sh -x
2    
3  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
4    
5  dir=$1  dir=$1
6    ip=$2
7    netmask=255.255.254.0
8    
9    test -z "$ip" && ip=10.60.0.253
10    
11  path=/$dir/etc/inittab  path=/$dir/etc/inittab
12  tmp=/tmp/inittab  tmp=/tmp/inittab
# Line 38  if ! grep /cgroup /etc/fstab ; then Line 42  if ! grep /cgroup /etc/fstab ; then
42          echo "cgroup /cgroup cgroup rw 0 0" >> /etc/fstab          echo "cgroup /cgroup cgroup rw 0 0" >> /etc/fstab
43  fi  fi
44    
45    grep eth0 $dir/etc/network/interfaces || cat << __interfaces__ > $dir/etc/network/interfaces
46    auto eth0 lo
47    
48    iface lo inet loopback
49    
50    iface eth0 inet static
51            address $ip
52            netmask $netmask
53    
54    __interfaces__
55    
56  mount | grep /cgroup || mount /cgroup || exit  mount | grep /cgroup || mount /cgroup || exit
57    
58  lxc-create -n ve2lxc -f $conf && read && lxc-start  -n ve2lxc  lxc-create -n ve2lxc -f $conf && lxc-start -n ve2lxc

Legend:
Removed from v.86  
changed lines
  Added in v.92

  ViewVC Help
Powered by ViewVC 1.1.26